Is it correct to say that there must be only one instance of a servlet if that servlet does not implement SingleThreadModel interface and that there may be one or more instances of any servlet that implement SingleThreadModel???
Originally posted by leandro oliveira: Is it correct to say that there must be only one instance of a servlet if that servlet does not implement SingleThreadModel
No . As if there is a mapping like <servlet> <servlet-name>First</servlet-name> <servlet-class>com.package.Hello</servlet-class> </servlet> <servlet> <servlet-name>Second</servlet-name> <servlet-class>com.package.Hello</servlet-class> </servlet> Then two instances will be created for each name.This may be helpful if u want to configure multiple <init-param> for same functionality.e.g. say if com.package.Hello servlet is used for connecting to database and user want to connect to two database, then user can configure two instance for each one
there may be one or more instances of any servlet that implement SingleThreadModel???
Correct.There "may be" one or more!!!
Joined: Nov 07, 2002
thanks! just one more question: where do I learn about these xml tags???
Joined: May 30, 2002
I referred Manning, in case u can't ... try to google around chk out links to scwcd deployment descriptor mentioned in this site !!
You are absolutely correct leandro unless you explicity define another two different servlet names referring to the same class. Not saying it isn't good practices, but I don't know when you would want to do this but I'm sure there is a reason. The Manning book entitled Exam Study Kit is a great resource for finding out these tags as well as a study guide.
SCJP 1.4, SCWCD
Java: The power, elegance, and simplicity of a hand grenade