Re: [OT] saving stats from session when session destroyed

2005-07-31 Thread Tamas Szabo
Craig McClanahan wrote: On 7/31/05, Tamas Szabo <[EMAIL PROTECTED]> wrote: Craig McClanahan wrote: One approach to consider is to make your listener implement HttpSessionAttributeListener as well as HttpSessionListener. That means you'll hear about session attributes being removed --

Re: [OT] saving stats from session when session destroyed

2005-07-31 Thread Craig McClanahan
On 7/31/05, Tamas Szabo <[EMAIL PROTECTED]> wrote: > Craig McClanahan wrote: > >One approach to consider is to make your listener implement > >HttpSessionAttributeListener as well as HttpSessionListener. That > >means you'll hear about session attributes being removed -- which is > >what happens a

Re: [OT] saving stats from session when session destroyed

2005-07-31 Thread Tamas Szabo
Craig McClanahan wrote: On 7/29/05, Varley, Roger <[EMAIL PROTECTED]> wrote: I could be losing my mind, but, I swear that I tried this technique once and by the time the sessionDestroyed() method was called, I was not able to get any of the session attributes back anymore. For various reason

Re: [OT] saving stats from session when session destroyed

2005-07-29 Thread Craig McClanahan
On 7/29/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > Craig McClanahan wrote the following on 7/29/2005 12:43 PM: > > > One approach to consider is to make your listener implement > > HttpSessionAttributeListener as well as HttpSessionListener. That > > means you'll hear about session attributes

Re: [OT] saving stats from session when session destroyed

2005-07-29 Thread Rick Reumann
Craig McClanahan wrote the following on 7/29/2005 12:43 PM: One approach to consider is to make your listener implement HttpSessionAttributeListener as well as HttpSessionListener. That means you'll hear about session attributes being removed -- which is what happens as the session is being inv

Re: [OT] saving stats from session when session destroyed

2005-07-29 Thread Craig McClanahan
On 7/29/05, Varley, Roger <[EMAIL PROTECTED]> wrote: > > > > I could be losing my mind, but, I swear that I tried this technique > > once and by the time the sessionDestroyed() method was called, I was > > not able to get any of the session attributes back anymore. For > > various reasons, the weba

RE: [OT] saving stats from session when session destroyed

2005-07-29 Thread Frank W. Zammetti
Well, there we go Van :) I would not have known that... I just got lucky in using containers that didn't follow the spec exactly :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Fri, July 29, 2005 5:29 am, Varley, Roger said: >> >> I co

RE: [OT] saving stats from session when session destroyed

2005-07-29 Thread Varley, Roger
> > I could be losing my mind, but, I swear that I tried this technique > once and by the time the sessionDestroyed() method was called, I was > not able to get any of the session attributes back anymore. For > various reasons, the webapps I develop need to be deployable in a > Servlet 2.3 environ

Re: [OT] saving stats from session when session destroyed

2005-07-29 Thread Van
On 7/28/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > > Believe me, I wouldn't have gone to all that trouble if the session > > data was available for me to get to the user attribute in the session. > > Interesting... I'd bet it was a peculiarity of the container's spec > implementation. Di

Re: [OT] saving stats from session when session destroyed

2005-07-28 Thread Frank W. Zammetti
Van wrote: I believe that Tomcat 4.x was at spec 2.3 level and Tomcat 5.x is at spec 2.4 level. In any case, I'm using a Jetty 4.2.x container which I'm absolutely certain only has spec 2.3 support. I'd bet your right about Tomcat... of course, either of us could go look it up in 10 seconds :)

Re: [OT] saving stats from session when session destroyed

2005-07-28 Thread Van
On 7/28/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > Nope, not as far as I know... in fact, I just implemented a listener > today that does some maintenace-type things like the code below, and it > works fine, that's under Tomcat 5.5.28 I believe... spec 2.3 as I recall? I believe that Tomca

Re: [OT] saving stats from session when session destroyed

2005-07-28 Thread Frank W. Zammetti
Nope, not as far as I know... in fact, I just implemented a listener today that does some maintenace-type things like the code below, and it works fine, that's under Tomcat 5.5.28 I believe... spec 2.3 as I tecall? sessionDestroyed() would be all but useless if you couldn't get at the attribut

Re: [OT] saving stats from session when session destroyed

2005-07-28 Thread Van
On 7/25/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > SessionListener is what you want. > > Here's an example from one of my apps (condensed for space)... it is used > to delete a temporary PDF that may have been generated for the user when > they log off: > > import company.app.User; > impo

Re: [OT] saving stats from session when session destroyed

2005-07-25 Thread Wendy Smoak
From: "Daniel Perry" <[EMAIL PROTECTED]> > I cant see an obvious way to find out when sessions are destroyed. You can register an HttpSessionListener and be notified of 'sessionCreated' and 'sessionDestroyed' events: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionLis

RE: [OT] saving stats from session when session destroyed

2005-07-25 Thread Daniel Perry
sers Mailing List > Cc: Struts User List > Subject: Re: [OT] saving stats from session when session destroyed > > > SessionListener is what you want. > > Here's an example from one of my apps (condensed for space)... it is used > to delete a temporary PDF that may have be

Re: [OT] saving stats from session when session destroyed

2005-07-25 Thread Dave Newton
Daniel Perry wrote: Would it be possible to have a class called stats, which is put into the session, and override the finalize method, so that this writes to the database the calls super.finalize? Would this work? Just as a followup to Frank's correct answer, _never_ count on a finalize me

Re: [OT] saving stats from session when session destroyed

2005-07-25 Thread Frank W. Zammetti
I guess it *might* be helpful to tell you you need an entry in web.xml for this... company.app.MySessionListener Yeah, that might help ;) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Mon, July 25, 2005 12:58 pm, Frank W. Zammetti

Re: [OT] saving stats from session when session destroyed

2005-07-25 Thread Frank W. Zammetti
SessionListener is what you want. Here's an example from one of my apps (condensed for space)... it is used to delete a temporary PDF that may have been generated for the user when they log off: import company.app.User; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionE