This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes regarding session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "regarding session" Watch "regarding session" New topic
Author

regarding session

santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi

I am working in one project in that any one user can log in after log in we will insert user id in database we will maintain about user using session, suppose he logged out means we will call some query to remove his status from database but in some time session will expire so i could not remove the status at database, how to remove status in database before expire session.



Thanking You.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This has nothing to do with Struts--I'm not sure what you're asking; are you asking about session listeners?
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi,

how to call a method automatically before session expire. please help me.

Thanking You
chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 77

What you want to put in database while session is active....this is expensive operation. You can directly store the data in session it self.
for example
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi,

You are telling absolutely right but session will expire by 30 minutes after 30 minutes how to deactivate in database.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I wrote:[...] are you asking about session listeners?
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi
Yes i am asking session listener how to write code for that can you help me.


Thanking You.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you looked at the API for HttpSessionListener? That's a link to it, by the way; clicky.
 
 
subject: regarding session