<s:if test="%{#parameters['paramName'][0] =='paramValue'}"> 

Thanks a lot! This worked! "parameters['paramName']" returns an array? 


-- K


________________________________
From: Wes Wannemacher <w...@wantii.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Mon, March 15, 2010 4:16:14 PM
Subject: Re: Parameter in If tag

Parameters that aren't bound to an action property can be tricky... I
would try some of the following to see if you can figure out what's
going on ->

<s:if test="%{#parameters.paramName.0 =='paramValue'}">
<s:if test="%{#parameters['paramName'] =='paramValue'}">
<s:if test="%{#parameters['paramName'][0] =='paramValue'}">

-Wes

On Mon, Mar 15, 2010 at 2:45 PM, Kusuma Haranath Atmakuri
<haranat...@yahoo.com> wrote:
> By the way, I am using Struts 2.1.8.1. Actually it was a WebWork app and 
> converting that into Struts2. Referring a parameter was so easy in ww with 
> just '$paramName'. It's weird that I am stuck at such a simple thing. Any 
> light on this would be of great help.
>
> Thank you!
>
>
>
>
> ________________________________
> To: user@struts.apache.org
> Sent: Sun, March 14, 2010 8:36:44 PM
> Subject: Parameter in If tag
>
> From the actions config, a parameter is being passed:
> <action ...>
>
>    <result>main.jsp?paramName=paramValue</result>
>
> When tried to access the paramName, it's fine when used in 'property' tag.
> <s:property value=%{#parameters.paramName} /> will print 'paramValue'.
>
> But when used in 'If' tag, it does NOT. Is there anything missing here? Tried 
> all the combinations of #, {}, %, double quotes and single quotes. Any help 
> would be greatly appreciated.
> <s:if test="%{#parameters.paramName=='paramValue'}"> will return FALSE.
>
> Thank you!
>
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


      

Reply via email to