struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: How to compare string reference variables using ognl?
Date Tue, 13 Dec 2011 01:45:36 GMT
In OGNL, the "==" test will call the equals method,
so, I believe the expression "#selectedOffer==#queryString" should work.

Read the following document:
http://commons.apache.org/ognl/language-guide.html
In the sector [Operators], there is a table describe all the operators.

If you think the test result is not correct, you need print out the
variables, to check what value they really are.


2011/12/12 mohan rao <mohanaraosv@gmail.com>:
> <s:set var="selectedOffer" value="%{ecOffers.dicountKey}"/>
> <s:iterator var ="entry" value = "#session.discountOffers">
> <s:set var="queryString" value="%{#entry.key}"/>
> <s:property value="selectedOffer.equals(queryString)"/>  It supposed to
> print true or false. But not printing any value
>
> <s:property value='#selectedOffer==#queryString'/> Printing false even they
> are same. (I think it's checking reference.)
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/How-to-compare-string-reference-variables-using-ognl-tp5060783p5067525.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
>

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


Mime
View raw message