This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get the session time out value from the web.xml

 
shyam ji gautam
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to compare

lastactivity time > sessiontimeout


then update some value in data base and then logout

how i get session time out value which i manually define in web.xml for this xml and session last activity time
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get lastAccessedTime and session timeout value both from the HttpSession interface methods. Read the JavaDocs for HttpSession.

But I think what you really need is a session listener, which listens for the timeout to occur. When timeout occurs and session is going to be destroyed then this listener will be notified and you can update the database using it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic