struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <greg.lindh...@gmail.com>
Subject Re: How to compare string reference variables using ognl?
Date Tue, 13 Dec 2011 14:10:30 GMT
On Mon, Dec 12, 2011 at 3:08 AM, mohan rao <mohanaraosv@gmail.com> wrote:
> Please delete my previous thread my query was not posted completely.
>
> <s:set var="selectedOffer" value="%{offers.dicountkey}"/>
> <s:iterator var ="entry" value = "#session.eligibleEcOffersMap">
> <s:set var="queryString" value="%{#entry.key}"/>
> T/F<s:property value="selectedOffer.equals(queryString)"/>  Nothing is
> printing.
>
> T/F<s:property value="#selectedOffer== #queryString"/> Always printing false
> even both are having same values.
>
> Thanks.
>
> --

You are using <s:set> so you need to use '#' to reference the
variables and since I assume these are strings you are going to want
to do .equals() not == (identity equals).

My guess is you want to do this:
   <s:property value="#selectedOffer.equals(#queryString)"/>

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


Mime
View raw message