I think that the correct test is:
<s:property value="#messageKey"/><br/>
<s:if test="%{#messageKey == 'yes'}">
yes
2009/12/22 foo bar <[email protected]>
> Hi all,
>
> I'm testing for the existence of a request parameter in a jsp page in
> Struts 2
>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <s:property value="#parameters.messageKey"/><br/>
> <s:if test="%{#parameters.messageKey == 'yes'}">
> yes
> </s:if>
> <s:else>
> no
> </s:else>
>
> But, whatever I do, result is always "no"
>
> Tested with these cases:
>
> test.jsp
> test.jsp?messageKey=
> test.jsp?messageKey=yes
> test.jsp?messageKey=no
>
> Changed it to <s:if test="#parameters.messageKey == 'yes'">, same results
> Changed it to <s:if test="{#parameters.messageKey == 'yes'}">, results
> are negated as above, ie you got "no" when previously you got "yes"
>
> What's the solution here ?
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Serafin Hernandez Blazquez
649 81 64 87