Yves Glodt ha scritto:
Hello,

this is probably a FAQ, but I failed to find ti anyway...

Where can I declare a static method that I want to be executed on tomcat or webapp startup?
I use this in web.xml

<servlet>
  <description>Env init</description>
  <servlet-name>ServiziServerInit</servlet-name>
  <servlet-class>xx.ServerInit</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
  <servlet-name>ServiziServerInit</servlet-name>
  <url-pattern>/SI</url-pattern>
</servlet-mapping>

"xx.ServerInit" is a regular servlet the code is in
init(ServletConfig config) method

edoardo


I have a properties file which I would like to read into a Map on startup, and have this Map available throughout my servlets and jsps.

How would I access this Map while the webapp is running?

I use a static variable, but maybe that someone can describe a more polite method.

Edoardo

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to