Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to refresh the date , without having to restart tomcat

 
Amit Phagwani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am working on a java application , on logging in to the application it mentions of the date on the login screen.
So if we do not shutdown tomcat one day , the next day it still shows the same old date.
we need to restart tomcat for it to pick the current date.
How do i fix this issue so that it refreshes the date automatically without having to restart
thanx
-a
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From where are you showing the date - JSP, Servlet etc.
Rene
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about on the page that shows the date, make sure you set the page to not cache on a client's machine?

There's plenty of post in this forum, and the Servlets forum about ensuring pages are not cached.

The other thing to consider is making sure you are placing this time into the correct servlet scope. I'd use request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic