You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/05/14 08:38:42 UTC

DO NOT REPLY [Bug 44994] New: JSP EL condition expression fails when nested : ${a ? b ? x: y: z}

https://issues.apache.org/bugzilla/show_bug.cgi?id=44994

           Summary: JSP EL condition expression fails when nested: ${a ? b ?
                    x: y: z}
           Product: Tomcat 6
           Version: 6.0.16
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: James.H.Manger@team.telstra.com


A JSP Expression Language (EL) conditional expression cannot have another
conditional expression as its "true" expression.

The following fails:
  ${0 lt a ? 1 lt a ? "many": "one": "none"}

It throws the following exception (the 19th character is the second question
mark):
  org.apache.el.parser.ParseException: Encountered "?" at line 1, column 19.
  Was expecting one of:
    "." ...
    "[" ...
...
       
org.apache.el.parser.ELParser.generateParseException(ELParser.java:1890)
        org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:1770)
        org.apache.el.parser.ELParser.Choice(ELParser.java:220)

The expression succeeds if brackets are added around the inner conditional
expression:
  ${0 lt a ? (1 lt a ? "many": "one"): "none"}

I assume the bug is in ELParser.jjt (in
apache-tomcat-6.0.16-src/java/org/apache/el/parser/). It uses Or(), instead of
Choice(), for the "true" expression.

WRONG:   Or() (<QUESTIONMARK> Or() <COLON> Choice() #Choice(3))*
RIGHT:   Or() (<QUESTIONMARK> Choice() <COLON> Choice() #Choice(3))*


Diff:
107c107
<       Or() (<QUESTIONMARK> Or() <COLON> Choice() #Choice(3))*
---
>       Or() (<QUESTIONMARK> Choice() <COLON> Choice() #Choice(3))*

This bug was not present in Tomcat 5.5.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 44994] JSP EL condition expression fails when nested: ${a ? b ? x: y: z}

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44994


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Mark Thomas <ma...@apache.org>  2008-05-20 15:39:53 PST ---
This has been fixed in 6.0.x and will be included in 6.0.17 onwards.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 44994] JSP EL condition expression fails when nested: ${a ? b ? x: y: z}

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44994





--- Comment #1 from Mark Thomas <ma...@apache.org>  2008-05-17 10:36:36 PST ---
This has been fixed in trunk and proposed for 6.0.x


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org