You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by quinquin2209 <qu...@yahoo.com.hk> on 2007/12/13 11:10:12 UTC

Problem with

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


Re: Problem with

Posted by Dave Newton <ne...@yahoo.com>.
OGNL treats a character in single-quotes as an actual character, not a
String.

d.

--- quinquin2209 <qu...@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