tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re[2]: multiple servlet instances?
Date Tue, 22 Oct 2002 17:53:37 GMT
Hello Craig,

Thanks for clearing up my partial disinformation :-)


Tuesday, October 22, 2002, 11:30:15 AM, you wrote:

CRM> On Tue, 22 Oct 2002, Jacob Kjome wrote:

>> Date: Tue, 22 Oct 2002 08:32:18 -0500
>> From: Jacob Kjome <>
>> Reply-To: Tomcat Users List <>
>> To: Tomcat Users List <>
>> Subject: Re: multiple servlet instances?
>> Well, there still can be multiple instances.  For instance, if you access
>> the servlet in different ways.  Every mapping of the servlet will beget a
>> new instance.  If you have a servlet class "com.mycompany.MyServlet" that
>> you've given the name "myservlet", then the following will beget two
>> instances of that servetl:
>> http://localhost:8080/myapp/servlet/com.mycompany.MyServlet
>> http://localhost:8080/myapp/servlet/myservlet
>> Then in you map "myservlet" to "/theservlet", now you have another instance
>> with:
>> http://localhost:8080/myapp/theservlet
>> So, that is is 3 instances in all.  However, it is still technically
>> correct that given any one instance, the container will not create multiple
>> instances of that instance, as Craig says.

CRM> The precise rule is that there is a single instance per servlet
CRM> *definition*, not per servlet *mapping*.  A servlet definition is:

CRM> * A single <servlet> element (no matter how many mappings point at it)
CRM>   from your web.xml file

CRM> * A dynamically created definition when you use the invoker servlet
CRM>   (i.e. the /servlet/* mapping), which is a Tomcat feature and nothing
CRM>   to do with the servlet specification.

>> Jake

CRM> Craig

CRM> --
CRM> To unsubscribe, e-mail:   <>
CRM> For additional commands, e-mail: <>

Best regards,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message