struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Problem with <s:if>
Date Thu, 13 Dec 2007 10:38:24 GMT
OGNL treats a character in single-quotes as an actual character, not a
String.

d.

--- quinquin2209 <quinquin2209-noip@yahoo.com.hk> wrote:

> 
> I have defined a hyperlink as follow:
> 
> <s:url id="inboxReceived" value="/main/list.action">
> 	<s:param name="state">I</s:param> 
> </s:url>
> 
> and when the page is called ,it will use the param "state" for processing
> as
> follow:
> 
> <s:if test="%{state=='I'}">
> Inbox - Received
> </s:if>
> <s:elseif test="%{state=='E'}">
> Inbox - Exported
> </s:elseif>
> <s:else>
> Not Found
> </s:else>
> 
> The NOT Found is always shown. However, if I change the param "state" to
> "IR" and change the testing condition to 
> 
> <s:if test="%{state=='IR'}">
> Inbox - Received
> </s:if>
> <s:elseif test="%{state=='IE'}">
> Inbox - Exported
> </s:elseif>
> <s:else>
> Not Found
> </s:else>
> 
> The correct result is returned.
> 
> Is there anything I need to do when the testing condition contains only 1
> character?
> -- 
> View this message in context:
> http://www.nabble.com/Problem-with-%3Cs%3Aif%3E-tp14313232p14313232.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