This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlets init method runs twice in WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets init method runs twice in WAS" Watch "servlets init method runs twice in WAS" New topic
Author

servlets init method runs twice in WAS

dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
does anyone know why / or can confirm that servlets initialise twice in websphere 3.5 advanced.
is this a known bug ? is htere a fix pack for it ? is this supposed to happen (i think not).
also has anyone experienced the fact that you cannot control the jsp page output buffer in the same app server. the jsp directives, and response.flushBuffer() do nothing . is this becsaue websphere isn't a full implementation of a J2EE appserver ?
FARRUKH ISMAIL
Greenhorn

Joined: May 13, 2002
Posts: 3
Hallo
Declaring servlet tag in web.xml more than once could cause the container to create new instances also check your calling servlet if it is doing something to create new instance of your servlet because init method being called twice means that there are instances of your servlet
Amir Kamran
Ranch Hand

Joined: Apr 21, 2002
Posts: 48
Hello!
If u specify a different name of servlet from its class name in web.xml like this
<servlet>
<servlet-name>
abc
</servlet-name>
<servlet-class>
xyz
</servlet-class>
</servlet>
this cause the container to create two instances of the servlet and init() method is called on each instantiation.
 
wood burning stoves
 
subject: servlets init method runs twice in WAS
 
Similar Threads
Websphere 4.5
Servlets init runs twice ?
Force Tomcat to throw IllegalStateException
Suggest Some WebSphere Training
bean class doubt