RE: How do I determine sessions within Tomcat?

2003-07-08 Thread James Courtney
Mark,
Another option is to write a callback class that is registered with each 
session using the HttpSessionBindingListener interface.  Each time a session is 
destroyed, either explicitly by the user or implicitly by Tomcat (user just closed 
browser) then your widget should have its valueUnbound method called and you could 
update your DB.

I haven't worked with the SessionListener before but that sounds more tailor made for 
the purpose you intend than my solution above.

Jamey


-Original Message-
From: Mark W. Webb [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 1:36 PM
To: Tomcat Users List
Subject: Re: How do I determine sessions within Tomcat?


All you need is the following in your context's web.xml file :


my.own.SessionListener


there should be an example in the examples context.  That is where I got 
mine from


Turansky, Mark wrote:

>ok, I see th session listener interface in the javadocs as well as the session event 
>class.  any advice regarding *how* I plug it into tomcat?  Is your method a standard 
>J2EE solution or will this be Tomcat specific?
>
>thanks for the quick reply,
>mark
>
>
>-Original Message-
>From: Mark W. Webb [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 08, 2003 4:30 PM
>To: Tomcat Users List
>Subject: Re: How do I determine sessions within Tomcat?
>
>
>you would probably want to write a SessionListener, and plug it into tomcat.
>
>Turansky, Mark wrote:
>
>  
>
>>I am required to track users and their sessions in my web application.  Is there a 
>>way to access all the sessions currently held in server memory?
>>
>>My application is tracking users in a database table.  Upon login, I log the session 
>>id along with a timestamp and other pertinent information.  If the user specifically 
>>clicks the "log out" button, I can update my table with another timestamp, but I 
>>assume many will simply timeout.  How do I update my table with their logout 
>>timestamp in the event of timeout?  I was hoping to make a simple maintenance thread 
>>in the background that would check existing sessions against my database table for 
>>this purpose.
>>
>>Thanks in advance,
>>Mark
>>
>>-
>>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]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>  
>

-- 
Mark Webb
Software Engineer
Dolphin Technology
474 Phoenix Drive
Rome, NY  13441-4911

Phone : 315.838.7000 
  : 315.838.7024
Fax   : 315.838.7096
Email : [EMAIL PROTECTED]





-
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]



Re: How do I determine sessions within Tomcat?

2003-07-08 Thread Mark W. Webb
All you need is the following in your context's web.xml file :


   my.own.SessionListener

there should be an example in the examples context.  That is where I got 
mine from

Turansky, Mark wrote:

ok, I see th session listener interface in the javadocs as well as the session event class.  any advice regarding *how* I plug it into tomcat?  Is your method a standard J2EE solution or will this be Tomcat specific?

thanks for the quick reply,
mark
-Original Message-
From: Mark W. Webb [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 4:30 PM
To: Tomcat Users List
Subject: Re: How do I determine sessions within Tomcat?
you would probably want to write a SessionListener, and plug it into tomcat.

Turansky, Mark wrote:

 

I am required to track users and their sessions in my web application.  Is there a way to access all the sessions currently held in server memory?

My application is tracking users in a database table.  Upon login, I log the session id along with a timestamp and other pertinent information.  If the user specifically clicks the "log out" button, I can update my table with another timestamp, but I assume many will simply timeout.  How do I update my table with their logout timestamp in the event of timeout?  I was hoping to make a simple maintenance thread in the background that would check existing sessions against my database table for this purpose.

Thanks in advance,
Mark
-
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]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Mark Webb
Software Engineer
Dolphin Technology
474 Phoenix Drive
Rome, NY  13441-4911
	
Phone : 315.838.7000 
 : 315.838.7024	
Fax   : 315.838.7096
Email : [EMAIL PROTECTED]





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


RE: How do I determine sessions within Tomcat?

2003-07-08 Thread Turansky, Mark
ok, I see th session listener interface in the javadocs as well as the session event 
class.  any advice regarding *how* I plug it into tomcat?  Is your method a standard 
J2EE solution or will this be Tomcat specific?

thanks for the quick reply,
mark


-Original Message-
From: Mark W. Webb [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 4:30 PM
To: Tomcat Users List
Subject: Re: How do I determine sessions within Tomcat?


you would probably want to write a SessionListener, and plug it into tomcat.

Turansky, Mark wrote:

>I am required to track users and their sessions in my web application.  Is there a 
>way to access all the sessions currently held in server memory?
>
>My application is tracking users in a database table.  Upon login, I log the session 
>id along with a timestamp and other pertinent information.  If the user specifically 
>clicks the "log out" button, I can update my table with another timestamp, but I 
>assume many will simply timeout.  How do I update my table with their logout 
>timestamp in the event of timeout?  I was hoping to make a simple maintenance thread 
>in the background that would check existing sessions against my database table for 
>this purpose.
>
>Thanks in advance,
>Mark
>
>-
>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]


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



Re: How do I determine sessions within Tomcat?

2003-07-08 Thread Mark W. Webb
you would probably want to write a SessionListener, and plug it into tomcat.

Turansky, Mark wrote:

I am required to track users and their sessions in my web application.  Is there a way to access all the sessions currently held in server memory?

My application is tracking users in a database table.  Upon login, I log the session id along with a timestamp and other pertinent information.  If the user specifically clicks the "log out" button, I can update my table with another timestamp, but I assume many will simply timeout.  How do I update my table with their logout timestamp in the event of timeout?  I was hoping to make a simple maintenance thread in the background that would check existing sessions against my database table for this purpose.

Thanks in advance,
Mark
-
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]


How do I determine sessions within Tomcat?

2003-07-08 Thread Turansky, Mark
I am required to track users and their sessions in my web application.  Is there a way 
to access all the sessions currently held in server memory?

My application is tracking users in a database table.  Upon login, I log the session 
id along with a timestamp and other pertinent information.  If the user specifically 
clicks the "log out" button, I can update my table with another timestamp, but I 
assume many will simply timeout.  How do I update my table with their logout timestamp 
in the event of timeout?  I was hoping to make a simple maintenance thread in the 
background that would check existing sessions against my database table for this 
purpose.

Thanks in advance,
Mark

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