struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <maurizio.cucchi...@gmail.com>
Subject Re: string concatenation within an EL conditional
Date Tue, 10 May 2011 17:12:53 GMT
I don't know if it works and/or it what you're looking for, but it
worths at least a try:

<s:a action="internal" namespace="/">
  <s:if test="mn != #m.name">
     <s:param name="cName" value="${cName}"/>
  </s:if>
${m.dispName}
</s:a>

Please let me know if it works.

On 10 May 2011 17:44, Scott Koenig <scott.l.koenig@gmail.com> wrote:
> Hello,
>
> This may fall under nested EL expressions, which to my understanding are
> intentionally disallowed, but I was wondering if there was EL syntax that
> would support what I am trying to do, namely, set a URL based on a
> conditional, or if I should stick with <s:if>.
>
> Currently I have
>
> <s:if test="mn == #m.name">
>    <a href="#landing">${m.dispName}</a>
> </s:if>
> <s:else>
>    <a href="/internal!m?cName=${cName}&mName=${m.name}">${m.dispName}</a>
> </s:else>
>
> but would like to do it in a single line, something like
>
> <a href="${mn == m.name ? '#landing' : '/internal!m?cName=' + cName +
> '&mName=' + m.name}">${m.dispName}</a>
>
> Is this possible?
>
> Thanks,
> ~~Scott
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message