• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets init method runs twice in WAS

 
dean tomlinson
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic