Originally posted by yogen joshi:
Hi,
Normally only 1 instance of a servlet is created, but if we configure the web server to have multiple instance say 10 instances of a servlet A, then in that situation, how many times will the init() method be called?
1 or 10 times?
Thanks in advance for your answer.
Yogen
I think the init will get call for 10 times as servletconfig is individual for each servlet and u have 10 instances of the servlet and if all have implemented SingleThreadModel than each time request comes a new instance will be initialised if old one is processing another request so if u have 10 single
thread servlets and u have 10 request to process simultaneously than 10 time init method will get called. this is not true in the case of multi threaded servlets.