struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Affan Qureshi" <quere...@etilize.com>
Subject Re: Actions and Sessions
Date Fri, 01 Nov 2002 04:33:53 GMT
Why dont you do:
request.getSession(true).setAttribute(PROFILE_KEY,profile) in the Action
object itself.

----- Original Message -----
From: "Bruce Van Horn" <bvh2@swbell.net>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, November 01, 2002 3:38 AM
Subject: Actions and Sessions


> What is the most efficient way to place information coming to a JSP from
an
> Action into a session object?
>
> I have an action that reads a database for user profile information.  It
> needs to be flexible enough such that changes to the data model don't
> require code changes in the Action.  This has been achieved -- the Action
> dynamically writes whatever comes back from the query.
>
> I can put these dynamic properties into the JSP with setAttributes() and
get
> them out on the other side, but I'd like to immediately store them in a
> session so the user's profile will be available for the entire session.
>
> The obvious approach is to create code in the JSP to create the session
and
> store the info.  However I want to utilize a frame for sidebar navigation,
> and since I include access permissions in the profile, I need all pages in
> the frames to have access to the profile info on page load.  This means I
> would have to code an intermediate page that loads the session data then
> forwards to the frames, which seems kludgy to me.
>
> Any ideas are greatly appreciated!  Thanks!
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message