Hi Kushan,

You can access the session object using a jsp scriplet and set your required
variables there.
<%
request.getSession().setAttribute("your_variable",obj)

%>


>From the Action class , you can get access to session either by implementing
the ServletRequestAware 
Interface within your action class or by implementing the SessionAware
interface.


request.getSession().getAttribute("var");

Thanks & Regards,
Mano

-----Original Message-----
From: Kushan Jayathilake [mailto:kusha...@gmail.com] 
Sent: Friday, June 18, 2010 10:32 AM
To: user@struts.apache.org
Subject: How to set a variable in session in the JSP

Hi Guys,

Can anyone suggest me a way to set a variable in the session in the JSP and
access that variable in the action class.. (variable must be set from the
JSP file to the session)

iam using struts 2.. is there anyway to do this..?

-- 
Regards
Kushan Jayathilake


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

Reply via email to