Java Mailing List Archive

http://www.junlu.com/

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

RE: [s2] String comparison with OGNL

Wesley Wannemacher

2007-01-23

Replies:

When I read your message, it occurred to me that OGNL couldn't know what
type `addrType' was because my Action is only a stub. #parameters is a
magical variable containing all of the request parameters, so I hadn't
thought of making getters/setters on my Action before.

So, I added a getAddrType() and setAddrType(String) then tried again.

I went through the whole gambit of syntaxes and I still can't find one that
works.

If I'm using the correct syntax, let me know because it could just be a bad
set of struts jars (which I can replace).

-Wes

> -----Original Message-----
> From: Tom Schneider [mailto:schneidh@(protected)]
> Sent: Tuesday, January 23, 2007 1:50 PM
> To: Struts Users Mailing List
> Subject: Re: [s2] String comparison with OGNL
>
> #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
>

Attachment: smime.p7s
©2008 junlu.com - Jax Systems, LLC, U.S.A.