Hey Nick-

Sounds like a good idea to me... You could override the sessionCreated()
method (instead of sessionDestroyed()). Something like:

public void sessionCreated(HttpSessionEvent hse) {
  if (application.getAttribute("UsersObject") != null) {
    // append to list,hashtable, or whatever and reset to application scope
    } ;
}

-drew

-----Original Message-----
From: Nick de Voil [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 17, 2002 5:07 AM
To: JRun-Talk
Subject: RE: Session END action


Drew

Would you see any practical problems with using this feature to maintain
an application variable containing the list of people currently logged
into an app?

Nick

----- Original Message -----
From: "Drew Falkman" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 5:54 PM
Subject: RE: Session END action


> Hey Amit-
>
> You can create a listener class that will watch sessions and execute a
> method when a session dies (or on other event triggers). Include the
> javax.servlet.http.* package, then write code like this to overwrite the
> default sessionDestroyed() constructor:
>
>   public void sessionDestroyed(HttpSessionEvent hse) {
>       log(
>         "*** Session Destroyed - Id:"+hse.getSession().getId()+" ***");
>   }
>
> Then add this reference to your class in the web.xml file:
>
> <listener>
>   <listener-class>myPackage.myClass.mySessionListener</listener-class>
> </listener>
>
> Hope this helps.
>
> Drew Falkman
> Team Macromedia, JRun


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=8
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=8
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to