• 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
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic