Discussions

XML & Web services: configuring Startup Class in Tomcat

  1. configuring Startup Class in Tomcat (3 messages)

    Hi,
    I'm using Tomcat 4.1.12 as a servlet engine. I have a Java Class which needs to be executed during startup of Tomcat. Where and how do I place this Java Class and what is the kind of entry that I need to make in the web.xml -
    (if any) , so that this class would execute on startup. This class is used to cache various property values from a file.

    Thanks in advance
    Orjun

    Threaded Messages (3)

  2. configuring Startup Class in Tomcat[ Go to top ]

    You could make it a servlet that loads on startup...

    <load-on-startup>2</load-on-startup>

    You could make the calls you need to make in the init() method of the servlet.
  3. configuring Startup Class in Tomcat[ Go to top ]

    Thanks,
    just a question...
    is <load-on-startup> a tag to be put in the web.xml file of Tomcat?

    Orjun
  4. configuring Startup Class in Tomcat[ Go to top ]

    Yes it goes in web.xml which is in your WAR. Your WAR could be put anywhere that supports it...Tomcat, WebSphere, etc...