struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kushan Jayathilake <kusha...@gmail.com>
Subject Re: How to set a variable in session in the JSP
Date Tue, 22 Jun 2010 09:05:39 GMT
Hi Mano,

Thanks for your reply, i got it sort out :)

-- 
Regards
Kushan Jayathilake


On Sun, Jun 20, 2010 at 11:58 AM, Mano Dasanayaka <d.mano@directfn.com>wrote:

> 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:kushanxp@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-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message