Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [s2] String comparison with OGNL

Tom Schneider

2007-01-23

Replies:

#parameters.addrType is of type String correct? If not, e.g. if it were an
enum, then I would expect all the comparisons to fail. You might try
#parameters.addrType.toString().equals('billing') and see if that gets it to
work.
Tom

On 1/23/07, Wesley Wannemacher <WesW@(protected):
>
> Nope, same result... Here is the code and output -
>
> ---CODE
>      <p class="sectionSubTitle">
> Please verify the details of your <s:property
> value="#parameters.addrType"/>
> address below -
>      </p>
>      <s:property value="%{#parameters.addrType == 'billing'}"/>
>
> ---RESULT
>      <p class="sectionSubTitle">
> Please verify the details of your billing address below -
>      </p>
>      false
>
>
> I'm not sure how much it matters, but I am working with a snapshot of
> 2.0.2
> that I built a while back. If this is an issue, I can replace any jars to
> see if that fixes the problem.
>
> -Wes
>
> > -----Original Message-----
> > From: Dave Newton [mailto:DNewton@(protected)]
> > Sent: Tuesday, January 23, 2007 1:36 PM
> > To: Struts Users Mailing List
> > Subject: RE: [s2] String comparison with OGNL
> >
> > From: Wesley Wannemacher [mailto:WesW@(protected)]
> > > <s:property value="#parameters.addrType == 'billing'"/>
> >
> > Does wrapping it with %{} do it?
> >
> > <s:property value="%{#parameters.addrType == 'billing'}"/>
> >
> > I still get a little confused when dealing with the different markups.
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
>
©2008 junlu.com - Jax Systems, LLC, U.S.A.