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] Commented: (EL-7) [el] Expressions with conditionals and unprefixed functions do not alway parse
Date Thu, 20 Sep 2007 06:20:12 GMT

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

Henri Yandell commented on EL-7:
--------------------------------

Other option - use the whitespace. ie) Don't allow a namespace to have a whitespace around
the :, and don't allow a ternary to not have a whitespace.

> [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
>            Assignee: Henri Yandell
>         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