Are you asking about TimeZone objects? The JVM has a default, which can be set with TimeZone.setDefault, but that would apply to the complete JVM, not just to one particular web app.
Anything that's done just once for a web app should go in the contextInitialized method of a ServletContextListener.
Joined: Sep 27, 2006
Thanks for the reply. But, Is there any particular method by which we can set timezone for that webapplication only.
If we call TimeZone.setDefault, from contextInitialized method of a ServletContextListener, I think it will still set timezone for entire JVM.
Joined: Mar 22, 2005
What does it mean to set a timezone for one particular web application? If you need a particular TimeZone object for a web app, you can create it and store it in the web app context for all web app code to use.