You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Anonymous (JIRA)" <ji...@apache.org> on 2008/11/13 08:51:37 UTC

[jira] Updated: (WW-325) Errors parsing if clauses in EL

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


    Status: Resolved  (was: Closed)

> Errors parsing if clauses in EL
> -------------------------------
>
>                 Key: WW-325
>                 URL: https://issues.apache.org/struts/browse/WW-325
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Expression Language
>    Affects Versions: WW 1.3
>            Reporter: Mike Cannon-Brookes
>            Assignee: Maurice C. Parker
>            Priority: Critical
>             Fix For: WW 1.4
>
>
> At the moment there is a bug in the Parser.
> It seems that if clause expressions with multiple nested method calls do not work.
> This doesn't work:
> <webwork:if test="/fieldHidden(long('project'), 'priority') == false">
>    works!
> </webwork:if>
> This works:
> <webwork:property value="long('project')">
> <webwork:if test="/fieldHidden(., 'priority') == false">
>    works!
> </webwork:if>
> </webwork:property>
> Notice that in the second if test, we only have one set of brackets in total.
> Here's the debug output for the if clause rendering:
> Doesn't work case:
> DEBUG [webwork.util.ServletValueStack] findValue() for: query="/fieldHidden" {[id="null" type="5" values=""]} {[id="fieldHidden" type="8" values=""]}
> Works case:
> DEBUG [webwork.util.ServletValueStack] findValue() for: query="/fieldHidden(., 'priority')" {[id="null" type="5" values=""]} {[id="fieldHidden" type="10" values=".,'priority'"]}
> Notice the query="" is different (and wrong in the first case).
> I tried to hack Parser.jj (using my trusty IDEA debugger) to fix it, but I uhm, got very lost in JavaCC cruft (ie I have no idea how JavaCC syntax actually works :)). 
> Could someone look at this? I think it should be pretty easy to replicate with a few simple test cases (nest some methods and check and if clause).
> Yell if you need any more information.

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