• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date in a servlet  RSS feed

 
Tyrone Chandler
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I wanted to know if anyone could tell me how I can put a Date or Calender object in a servlet so that it tells me how long it's been since i last visited a page? Thanks so much!
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you'd need a javax.servlet.http.HttpSession object to hold onto that calendar/date object for you, and HttpSession has a getLastAccessedTime() method, why not just use it?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!