glassfish
  1. glassfish
  2. GLASSFISH-17628

#{foo[bar](baz)} fails with com.sun.el.parser.ParseException: Encountered "("

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.2_b13
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Eclipse Indigo SR1, Glassfish 3.1.1, Win 7 x64

      Description

      As an example, this view:

      <ui:param name="p1" value="#{bean}" />
      <ui:param name="p2" value="method1" />
      <ui:param name="p3" value="#{bean.toString()}" />
      
      <h:form>
          <h:commandButton value="submit" action="#{p1[p2](p3)}" /> 
      </h:form>
      

      with this bean:

      @ManagedBean
      @RequestScoped
      public class Bean {
      
          public void submit(String arg) {
              System.out.println("submit with " + arg);
          }
      
      }
      

      works fine on Tomcat 7.0.22, but Glassfish fails while loading the page:

      Caused by: javax.el.ELException: Error Parsing: #{p1[p2](p3)}
      	at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:174)
      	at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:191)
      	at com.sun.el.lang.ExpressionBuilder.createMethodExpression(ExpressionBuilder.java:242)
      	at com.sun.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:81)
      	at org.jboss.weld.util.el.ForwardingExpressionFactory.createMethodExpression(ForwardingExpressionFactory.java:43)
      	at org.jboss.weld.el.WeldExpressionFactory.createMethodExpression(WeldExpressionFactory.java:62)
      	at com.sun.faces.facelets.tag.TagAttributeImpl.getMethodExpression(TagAttributeImpl.java:222)
      	... 63 more
      Caused by: com.sun.el.parser.ParseException: Encountered "(" at line 1, column 9.
      Was expecting one of:
              (*snip*)
      

      Chapter 1.19 of EL spec says:

      ValueSuffix      ::= '.' Identifier MethodParameters?
                          | '[' Expression ']' MethodParameters?          <-- Look here
      MethodParameters ::= '(' (Expression (',' Expression )* )? ')'
      

      So, I think that Apache EL is right. Can you please fix it for Glassfish as well?

        Activity

        Hide
        balusc added a comment -

        I can't edit it anymore, but in the first snippet,

        <ui:param name="p2" value="method1" />
        

        should have been

        <ui:param name="p2" value="submit" />
        
        Show
        balusc added a comment - I can't edit it anymore, but in the first snippet, <ui:param name= "p2" value= "method1" /> should have been <ui:param name= "p2" value= "submit" />
        Hide
        kchung added a comment -

        Fixed.

        Show
        kchung added a comment - Fixed.

          People

          • Assignee:
            kchung
            Reporter:
            balusc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: