commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (EL-7) [el] Expressions with conditionals and unprefixed functions do not alway parse
Date Mon, 20 Aug 2007 10:15:30 GMT

     [ https://issues.apache.org/jira/browse/EL-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henri Yandell updated EL-7:
---------------------------

    Attachment: EL-7.patch

Unit test attached that reproduces this bug.

> [el] Expressions with conditionals and unprefixed functions do not alway parse
> ------------------------------------------------------------------------------
>
>                 Key: EL-7
>                 URL: https://issues.apache.org/jira/browse/EL-7
>             Project: Commons EL
>          Issue Type: Bug
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Richard Backhouse
>             Fix For: 1.1
>
>         Attachments: EL-7.patch
>
>
> If you take a el expression of the form :
> ${true ? a : reverse("Foo")}
> The commons el parser will fail to parse this.
> The ambiguity between the Conditional rule and the Function rule (both using ":"
> as a token) seems to cause the parser problems.
> Here is a jsp that can be used to easily verify this :
> <%@page contentType="text/html"%>
> <html>
> <body>
> <%
> String expr = "${true ? a : reverse(\"Foo\")}";
> try {
>    pageContext.getExpressionEvaluator().parseExpression(expr,
>                                                         java.lang.String.class,   
>                                                         null);
>    out.println("Parsed " + expr);
> }
> catch (javax.servlet.jsp.el.ELException e) {
>    out.println("Failed to parsed "+ expr + " : " + e.getMessage());
> }
> %>
> </body>
> </html>
> Just by adding a prefix to the function or changing the true condition to
> something other than a value will make it parse.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message