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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to