You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GF <ga...@gmail.com> on 2007/11/20 10:58:44 UTC

[s2][ognl] and with a string.

I have this code:

<s:if test="myVar == 'myvalue'">
XXX
</s:if>

<s:set name="otherVar" value="%{myVar}"  />

<s:if test="otherVar == 'myvalue'">
YYY
</s:if>

This code shows XXX but doesn't show YYY.
How can I satisfay the second test?

Thank you.

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


Re: [s2][ognl] and with a string.

Posted by GF <ga...@gmail.com>.
Ok, thank you again.

On Nov 20, 2007 11:21 AM, LEONARD Julien (Consulting for ACCOR Hotels)
<ju...@consulting-for.accor.com> wrote:
>
> In fact belong my experience of Struts2, the good way to make an expression is with %{ }.
> And for all variables declared in JSP (s:set, or status of s:iterator ) are accessible with a #.
> Maybe these variables are in pageContext and not the valueStack, and "#" is the way to acces to the pageContext.
>
> Julien
>

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


RE: [s2][ognl] and with a string.

Posted by "LEONARD Julien (Consulting for ACCOR Hotels)" <ju...@consulting-for.accor.com>.
In fact belong my experience of Struts2, the good way to make an expression is with %{ }. 
And for all variables declared in JSP (s:set, or status of s:iterator ) are accessible with a #.
Maybe these variables are in pageContext and not the valueStack, and "#" is the way to acces to the pageContext.

Julien

-----Message d'origine-----
De : GF [mailto:ganfab@gmail.com] 
Envoyé : mardi 20 novembre 2007 11:15
À : Struts Users Mailing List
Objet : Re: [s2][ognl] <s:set .. > and <s:if .. > with a string.

Wow.
Now It works.
Can you explain me the difference with my version?
Or have you any good link to some guide to understand what I did wrong?

Thank you.

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


This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
********************************************************************** 
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
********************************************************************** 


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


Re: [s2][ognl] and with a string.

Posted by GF <ga...@gmail.com>.
Wow.
Now It works.
Can you explain me the difference with my version?
Or have you any good link to some guide to understand what I did wrong?

Thank you.

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


RE: [s2][ognl] and with a string.

Posted by "LEONARD Julien (Consulting for ACCOR Hotels)" <ju...@consulting-for.accor.com>.
Hello

Try like this :

<s:if test="myVar == 'myvalue'">
XXX
</s:if>

<s:set name="otherVar" value="%{myVar}"  />

<s:if test="%{#otherVar == 'myvalue'}">
YYY
</s:if> 

-----Message d'origine-----
De : GF [mailto:ganfab@gmail.com] 
Envoyé : mardi 20 novembre 2007 10:59
À : user@struts.apache.org
Objet : [s2][ognl] <s:set .. > and <s:if .. > with a string.

I have this code:

<s:if test="myVar == 'myvalue'">
XXX
</s:if>

<s:set name="otherVar" value="%{myVar}"  />

<s:if test="otherVar == 'myvalue'">
YYY
</s:if>

This code shows XXX but doesn't show YYY.
How can I satisfay the second test?

Thank you.

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


This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
--------------------------------------------------------------------------------------------------------------
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
-------------------------------------------------------------------------------------------------------------


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