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

Lukasz Lenart updated WW-3375:
------------------------------

    Fix Version/s: 3.x
    
> <s:if> inside <s:url> is not being processed -- entire conditional is ignored.
> ------------------------------------------------------------------------------
>
>                 Key: WW-3375
>                 URL: https://issues.apache.org/jira/browse/WW-3375
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.1.8
>         Environment: Glassfish v2.1.1
>            Reporter: Sam Sorrell
>            Priority: Minor
>             Fix For: 3.x
>
>
> When an "if" tag is placed within a "url" tag, the "if" tag is completely 
> ignored.  For the following example the resulting url will not have a "page" 
> parameter regradless of the value of "parameter". 
>     <s:url id="myHelpUrl" action="myHelpAction" namespace="/myNamespace">
>         <s:param name="section" value="%{'Section'}"/>
>         <s:param name="component" value="%{'Component'}"/>
>         <s:if test="%{bean.primaryKey != null">
>             <s:param name="page" value="%{'Update'}"/>
>         </s:if>
>         <s:else>
>             <s:param name="page" value="%{'Add'}"/>
>         </s:else>
>     </s:url>
> By contrast, the following less concise version has the "page" parameter:
> <s:if test="%{bean.primaryKey != null}">
>     <s:url id="myHelpUrl" action="myHelpAction" namespace="/myNamespace">
>         <s:param name="section" value="%{'Section'}"/>
>         <s:param name="component" value="%{'Component'}"/>
>         <s:param name="page" value="%{'Update'}"/>
>     </s:url>
> </s:if>
> <s:else>
>     <s:url id="myHelpUrl" action="myHelpAction" namespace="/myNamespace">
>         <s:param name="section" value="%{'Section'}"/>
>         <s:param name="component" value="%{'Component'}"/>
>         <s:param name="page" value="%{'Add'}"/>
>     </s:url>
> </s:else>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to