Dear Tomcat users,

What is the best way to create some objects which are going to be available
application-wide to a bunch of servlets from the same web-app? Or in other
words, is there an equivalent of an init() method but for the application as a
whole?

At the moment, I am having to clutter the init() method of all my servlets with
code to check if the object has been created and create it if it hasn't. I have
to do that because I am not sure which servlet will be invoked first. 

Am I missing something? Is there any way to do that in the xml descriptor file?

Thanks for your help,

Guillaume Barreau

Reply via email to