Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

How to session attributes Struts 2.0.6

tom tom

2007-03-15

Replies:

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@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.