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 <mohanara...@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-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org