You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jeto <je...@gmx.at> on 2009/03/04 13:16:58 UTC

[s2] Would like to do

Hi,

I would like to do the following


<s:if test="foo.contains('N')">

Is it possible do to that or not. Everything I tried yet gives me a false in
the test statement.


Any ideas?


Bye
Hagen
-- 
View this message in context: http://www.nabble.com/-s2--Would-like-to-do-%3Cs%3Aif-test%3D%22foo.contains%28%27N%27%29%22%3E-tp22328913p22328913.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [s2] Would like to do

Posted by Dave Newton <ne...@yahoo.com>.
jeto wrote:
> Ok, it was my fault the foo object was not a String it was an enum type.
> But still is it possible to do something like contains?

OGNL can call arbitrary methods.

Dave


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


Re: [s2] Would like to do

Posted by jeto <je...@gmx.at>.
Ok, it was my fault the foo object was not a String it was an enum type.
But still is it possible to do something like contains?

-- 
View this message in context: http://www.nabble.com/-s2--Would-like-to-do-%3Cs%3Aif-test%3D%22foo.contains%28%27N%27%29%22%3E-tp22328913p22348897.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [s2] Would like to do

Posted by Dave Newton <ne...@yahoo.com>.
jeto wrote:
> <s:if test="foo.contains('N')">
> 
> Is it possible do to that or not. Everything I tried yet gives me a false in
> the test statement.
> 
> Any ideas?

I'd guess it's a string v. char issue, without actually knowing what you 
have in your map:

http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html

Dave

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


Re: [s2] Would like to do

Posted by Dale Newfield <da...@newfield.org>.
http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html

-Dale

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