I'm pretty sure I remember someone asking this question before, but I was unable to find it either in my archives or in nabble...

I basically want "includeParams" for a specific parameter, and I thought I could do it just by conditionally including the parameter like so:

<a href='<s:url action="removeFavorite" namespace="">
           <s:param name="mediaCode" value="%{media.code}"/>
           <s:if test="%{#parameters.decorator.length > 0}">
             <s:param name="decorator" value="%{#parameters.decorator}"/>
           </s:if>
           </s:url>'><fmt:message key="viewMedia.removeFavorite"/></a>

It doesn't work.

I guess I can always include the param and just change the value based on a condition:

<a href='<s:url action="removeFavorite" namespace="">
           <s:param name="mediaCode" value="%{media.code}"/>
<s:param name="decorator" value="%{(#parameters.decorator.length > 0)?(#parameters.decorator):('')}"/>
           </s:url>'><fmt:message key="viewMedia.removeFavorite"/></a>

but I wanted to ask if there's any sensible way to make the first solution work? I understand that the s:if tag is conditionally allowing the body to be added to the output, which is different from conditionally deciding whether or not to execute the body, and I understand that it's likely the s:url tag understands s:param children but not s:if children... ...but I could see a desirable use-case where someone wants to nest an s:iterator inside a s:url, too, and it would be nice if these types of constructs could work...

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to