Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11481

EL expressions that contain unnecessary parentheses fail

XMLWordPrintable

      EL with unnecessary parentheses fail. For instance:

            <c:set var = "i" scope = "session" value = "1"/>
              <c:if test="${(i) == '1'}">                   
               <p>i is:  <c:out value = "${i}"/><p>
              </c:if>
      

      The root exception clarified by byteman is:

      15:16:51,903 INFO  [stdout] (http_8080 task-1) ----------------------->ParseException.init
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ParseException.<init>(ParseException.java:179)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.generateParseException(ELParser.java:2963)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:2845)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.LambdaExpression(ELParser.java:295)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.Assignment(ELParser.java:226)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.SemiColon(ELParser.java:181)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.Expression(ELParser.java:174)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.DynamicExpression(ELParser.java:146)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:43)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:182)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:237)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:295)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:112)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$JspAttribute.validateEL(Node.java:2151)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1400)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1204)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:855)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1535)
      15:16:51,904 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1834)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:652)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
      15:16:51,905 INFO  [stdout] (http_8080 task-1) javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      

      Parser seems confused as if there's a Lamda expression to resolve. Seems tomcat had a similar issue:

      https://bz.apache.org/bugzilla/show_bug.cgi?id=56179

        1. helloworld.war
          7 kB
          Teresa Miyar Gil

              rhn-support-rmartinc Ricardo Martin Camarero
              rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: