4 Replies Latest reply on Aug 4, 2017 2:18 AM by Norito Agetsuma

    jastow: don't remove escape charator in jsp template text

    Norito Agetsuma Newbie

      Hi,

       

      I'm migrating my application from JBoss AS7 to WildFly 10.1.0.

      In JBoss AS7.1(JBoss Web), jsp template text "\\$" escape to "\$", wildfly10 don't remove escape charactor.

       

      My application code is following. Because of wildfly10 don't remove "/", javascript regex don't match.

      <%@page contentType="text/html" pageEncoding="UTF-8"%>

      <!DOCTYPE html>

      <html>

          <head>

              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

              <title>JSP Page</title>

              <script>

                  window.onload = function(e) {

                      var message = "$1 template value";

                      // JBoss AS 7 - JBoss Web \\$ -> \$   (remove \)

                      // Wildfly 10 - Undertow  \\$ -> \\$  (don't remove \)

                      var matched = message.match(/^(\\$\d+)/);

                      if (matched != null) {

                          matched.forEach(function (item, index, array) {

                              // captured 

                              console.log(item);

                          });

                      }

                  };

              </script>

       

      I suppose the cause is jastow don't backport tomcat 8.0.27 change org.apache.jasper.compiler.Parser, following two commits.

      Ensure only \${ and \#{ are treated as escapes for ${ and #{ rather t… · apache/tomcat@0e4ee15 · GitHub

      Follow up to r1634089. · apache/tomcat@fb5bb7c · GitHub

      For EL expressions used within attribute values: · apache/tomcat@8063bb3 · GitHub

       

      In tomcat community, tomcat 8.0.15 change don't remove "\" in "\\$", but found out later that the change is regression, tomcat 8.0.27 back to before tomcat 8.0.14 behaviour.

      57136 – EL Parser escaping dollar sign not ${ or ${...}

       

      For backword compatibility, it may as well jastow backport new version jasper entirely or apply partial patch like attachment.

      Any help with this would be appreciated.

       

      Thank you,

      Norito Agetsuma