You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Shabada, Gnaneshwer" <sh...@toysrus.com> on 2004/10/20 00:59:38 UTC

How to retrieve session variables using Struts tag in JSP

Hello,
I am trying to retrieve a flag value ( that I put in session in my Action
class ) in my JSP. I tried <bean:define> tags and other struts tags but no
luck. Can anyone point me which tag does this? I also used <logic:match>
<logic:present> tags but no use.

I tried this where the parameter is the session attribute and "admin" is its
literal value.

<logic:match parameter="loggedUser" value="admin">

Please help

TIA
Gnan

======================================================================== 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to EmailAdmin@toysrus.com. 
Toys "R" Us, Inc.

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


Re: How to retrieve session variables using Struts tag in JSP

Posted by Craig McClanahan <cr...@gmail.com>.
If "loggedUser" is a string you put in session scope, use this instead:

  <logic:match name="loggedUser" value="admin">

If on the other hand you had a bean that you stored under session
scope under key "foo", and this bean class has a getLoggedUser()
method on it, you'd use:

  <logic:match name="foo" property="loggedUser" value="admin">

The "parameter" attribute is for accessing request parameters that
came in from the client, not request or session attributes that your
applicaton stores.

Craig


On Tue, 19 Oct 2004 18:59:38 -0400, Shabada, Gnaneshwer
<sh...@toysrus.com> wrote:
> 
> Hello,
> I am trying to retrieve a flag value ( that I put in session in my Action
> class ) in my JSP. I tried <bean:define> tags and other struts tags but no
> luck. Can anyone point me which tag does this? I also used <logic:match>
> <logic:present> tags but no use.
> 
> I tried this where the parameter is the session attribute and "admin" is its
> literal value.
> 
> <logic:match parameter="loggedUser" value="admin">
> 
> Please help
> 
> TIA
> Gnan
> 
> ========================================================================
> This email message is for the sole use of the intended recipient (s) and may
> contain confidential and privileged information. Any unauthorized review,
> use, disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message. To reply to our email administrator directly, send
> an email to EmailAdmin@toysrus.com.
> Toys "R" Us, Inc.
> 
> ---------------------------------------------------------------------
> 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