No problem, it's a good habit to get into checking the javadoc or user guides before posting a question to a list or forum. Not that we don't want to help; it just allows you to ask good questions.

Good luck!
David




From: "atta ur-rehman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Session Cleanup
Date: Thu, 17 Oct 2002 18:10:31 -0700

Thanks David, that certainly help. And excuse me for my naivety!

Thanks once more.

Regards,

ATTA

----- Original Message -----
From: "David Graham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 17, 2002 5:44 PM
Subject: Re: Session Cleanup


> Well, in the ServletRequest interface there are 2 methods getAttribute and
> setAttribute (you'll find identical methods in HttpSession and
> ServletContext). This is how you put objects into various scopes.
>
> So, in one of your Actions you would say:
>
> request.setAttribute("someName", myCollection);
>
> The jsp you forward to can get the myCollection object by saying:
>
> in JSTL: ${requestScope.someName}
>
> in jsp expression <%= request.getAttribute("someName") %>
>
> Does that help?
>
> Dave
>
>
>
>
>
>
> >From: "atta ur-rehman" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Re: Session Cleanup
> >Date: Thu, 17 Oct 2002 14:43:48 -0700
> >
> >Ok, David, I read the doc! now what?
> >----- Original Message -----
> >From: "David Graham" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Thursday, October 17, 2002 1:58 PM
> >Subject: Re: Session Cleanup
> >
> >
> > > Try looking through the servlet javadoc here:
> > > http://java.sun.com/j2ee/sdk_1.3/techdocs/api/
> > >
> > > Look at HttpServletRequest and HttpSession
> > >
> > > David
> > >
> > >
> > >
> > > >From: "atta ur-rehman" <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>
> > > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > >Subject: Re: Session Cleanup
> > > >Date: Thu, 17 Oct 2002 13:55:55 -0700
> > > >
> > > >Thanks Craig. That explains. I think we can afford few more cpu
cycles
> > > >instead of memory. Now is there a way to store collections in the
> >request
> > > >scope instead of session scope? by collections I mean, collections
used
> >to
> > > >populate <html:select> controls?
> > > >
> > > >ATTA
> > > >
> > > >----- Original Message -----
> > > >From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> > > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > >Sent: Thursday, October 17, 2002 1:36 PM
> > > >Subject: Re: Session Cleanup
> > > >
> > > >
> > > > >
> > > > >
> > > > > On Thu, 17 Oct 2002, atta ur-rehman wrote:
> > > > >
> > > > > > Date: Thu, 17 Oct 2002 13:36:41 -0700
> > > > > > From: atta ur-rehman <[EMAIL PROTECTED]>
> > > > > > Reply-To: Struts Users Mailing List
> ><[EMAIL PROTECTED]>
> > > > > > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > > > > > Subject: Re: Session Cleanup
> > > > > >
> > > > > > Thanks, David. Putting commonly used collection in the
application
> > > >scope
> > > >is
> > > > > > a nice idea; both for storage space and performance reasons.
> > > > > >
> > > > > > Now how do I store my form beans in request instead of session?
Is
> >it
> > > >the
> > > > > > "scope" attribute of the action mapping that determines it?
> > > > >
> > > > > Yes.
> > > > >
> > > > > > And what are
> > > > > > performance implications of this change?
> > > > >
> > > > > The set of attributes in the request or session object supplied by
> >the
> > > > > servlet container is usually a HashMap, so performance of storing
> >the
> > > >form
> > > > > bean in either is equivalent. However, your app will benefit from
> >the
> > > > > fact that the form bean is automatically released at the end of
the
> > > > > request, so the overall memory occupancy of your app will likely
be
> > > >lower,
> > > > > but the CPU time consumption might be higher (due to increased
> >garbage
> > > > > collection).
> > > > >
> > > > > For most apps, this tradeoff is very much worth it because having
> >excess
> > > > > CPU capacity is more common than having excess memory to store the
> >form
> > > > > beans in session scope in between requests.
> > > > >
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > ATTA
> > > > >
> > > > > Craig
> > > > >
> > > > >
> > > > > --
> > > > > 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>
> > >
> > >
> > > _________________________________________________________________
> > > Surf the Web without missing calls! Get MSN Broadband.
> > > http://resourcecenter.msn.com/access/plans/freeactivation.asp
> > >
> > >
> > > --
> > > 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>
>
>
> _________________________________________________________________
> Surf the Web without missing calls! Get MSN Broadband.
> http://resourcecenter.msn.com/access/plans/freeactivation.asp
>
>
> --
> 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>

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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

Reply via email to