[
https://issues.apache.org/jira/browse/WW-3375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rene Gielen resolved WW-3375.
-----------------------------
Resolution: Not A Problem
Fix Version/s: (was: 2.5)
2.3.2
Assignee: Rene Gielen
I don't think that allowing <if> tags in <url> is a solution we want to allow,
especially since your usecase is easy to fix either with a <if><set>
combination outside the url tag or with a simple OGNL expression like <s:param
name="page" value="%{bean.primaryKey != null ? 'Update' :'Add'}"/>
> <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
> Assignee: Rene Gielen
> Priority: Minor
> Fix For: 2.3.2
>
>
> 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