Although, I didn't consider this solution, which seems sort of broken
but appears to at least work and provide the desired effect:
<s:param name="%{#attr.row.department==null?'d':'department'}">
<s:property value="%{#attr.row.department}"/>
</s:param>
If the department value is null, the request parameter is named "d"
rather than "department". It is only "department" when the parameter is
not null.
I still do not understand why you cannot wrap a s:param tag with a s:if
construct to control whether a parameter is appended to the s:url or
not.
According to Eclipse, placing a s:if inside the s:url around an s:param
is not considered abnormal use of the tags, so I'm at a loss.
> -----Original Message-----
> From: Dale Newfield [mailto:[email protected]]
> Sent: Thursday, February 25, 2010 11:35 AM
> To: Struts Users Mailing List
> Subject: Re: s:if inside s:url
>
> CRANFORD, CHRIS wrote:
> > <s:if test='%{#attr.row.department != null}'>
> > <s:param name='department'><s:property
> > value='#attr.row.department'/></s:param>
> > </s:if>
>
> <s:param name="department" value="%{(#attr.row.department ==
> null)?'':#attr.row.department}"/>
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]