Servlet init() called twice on startup
843841Feb 1 2006 — edited Jul 10 2008Hi,
SunOne6.1 sp 5 is running my servlet's init() method twice when I put load-on-startup in the web-xml file. Is this a known problem and is there a work around as no amount of synchronising seems to work.
I'm running 2.3.dtd for the default_web.xml file and my entries look like this :-
<servlet>
<servlet-name>RelatisLogin</servlet-name>
<servlet-class>com.MyServlet</servlet-class>
<load-on-startup>7</load-on-startup>
</servlet>
This init method only contains a basic check at the moment :-
public void init()
{
System.out.println("init.....");
}
If I take <load-on-startup> away and run the server then call the servlet via the url it only runs init once.
Thanks in advance for any help.
Chris.