I am supporting Websphere 4.03, and also using a class that implements 
HttpSessionBindingListener. What I have done is create a "cleanUp()" 
method within this class that does all my clean up, then valueUnbound() 
just calls my cleanUp() method. 

Susan Bradeen

On 03/18/2003 04:02:52 PM david chan wrote:

> My problem is I have a class implements
> HttpSessionBindingListener, then in method valueBound
> and valueUnBound(HttpSessionBindingEvent se), I need
> to access servletContext, but can't found a way to get
> there.
> I know from Action class/JSP/Servlet, I can get
> servletContext.
> 
> What I trying to do is everytime a session expired or
> invalidated, I need to do a clearup of this session
> related data in a Hashtable stored in application
> scope.
> 
> I already implemented in servlet api 2.3, but just
> found out can't deploy to websphere 4.x because it
> only supports api 2.2.
> 
> Thanks.
> David
> 
> 
> --- "Hajratwala, Nayan (N.)" <[EMAIL PROTECTED]>
> wrote:
> > You can use HttpServlet.getServletContext()
> >
> > ... or if you are in a jsp/tag,
> > PageContext.getServletContext()
> >
> > ---
> > - Nayan Hajratwala
> > - Chikli Consulting LLC
> > - http://www.chikli.com
> >
> >
> > -----Original Message-----
> > From: david chan [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 18, 2003 3:46 PM
> > To: Struts Users Mailing List
> > Subject: how to get servletContext from httpsession
> > ? (servlet api 2.2)
> >
> >
> > Hi,
> >  My webapp use HttpSession.getServletContext()
> > method
> > and works fine on tomcat 4.x. but not in websphere
> > 4.x.
> > I just figure out HttpSession.getServletContext()
> > method is only avilable on servlet api 2.3.
> >  So in api 2.2, how can I do similar things? What I
> > need is in valueBound(HttpSessionBindingEvent se)
> > method to get an attribute from the application
> > scope.
> >  With api 2.3, this seems so easy, but api 2.2
> > confuse
> > me.
> >
> >  Thanks.
> > David
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> > live on your desktop!
> > http://platinum.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to