struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Rodrigues <feliperod...@yahoo.com.br>
Subject Re: How to session attributes Struts 2.0.6
Date Fri, 16 Mar 2007 18:59:57 GMT

You can use the interceptor ServletConfig to get HTTPServletRequest and
HTTPServletResponse.

But hte best way is to implements SessionAware interface in your action
class.
Take a look at this link.
http://struts.apache.org/2.x/docs/how-do-we-get-access-to-the-session.html

regards,

Felipe


Tracy12 wrote:
> 
> Hi,
> 
> How can we set the session variables which we used to
> do in stuts 1.x. and thereafter access in the jsps.
> 
> e.g.
> 
> session.setAttribute("NAME","USER11");
> 
> and in jsp
> 
>  <logic:equal name="NAME" value="USER11">
>           This message is for user 1
>  </logic:equal>
> 
> 
> How can we access to the session, should it be as 
> follows
> 
> In execute method
> 
> 
>   RenderRequest req =
> PortletActionContext.getRenderRequest();
> 
>         
> 
>         
> 
> PortletSession session=req.getPortletSession();
> 
>         session.setAttribute("NAME","USER1");
> 
> 
>  
> ____________________________________________________________________________________
> Bored stiff? Loosen up... 
> Download and play hundreds of games for free on Yahoo! Games.
> http://games.yahoo.com/games/front
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-session-attributes-Struts-2.0.6-tf3406479.html#a9520542
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


Mime
View raw message