tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Eaves <>
Subject Re: multiple servlet instances?
Date Wed, 23 Oct 2002 01:53:29 GMT
Craig R. McClanahan wrote:
> On Mon, 21 Oct 2002, Nick Wesselman wrote:
>>Date: Mon, 21 Oct 2002 18:07:42 -0500
>>From: Nick Wesselman <>
>>Reply-To: Tomcat Users List <>
>>To: Tomcat Users List <>
>>Subject: Re: multiple servlet instances?
>>the book was actually referring to the case where isThreadSafe="false"
>>... it uses misleading wording, however.
>>"... you also need to be aware that, even if a JSP page sets the
>>isThreadSafe attribute to false, JSP implementations are still
>>permitted to create multiple instances of the corresponding servlet..."
>>(my emph)
>>"Web Development with Java Server Pages" by Duane Fields and Mark Kolb
>>... p. 62 ... I just got a fax of the page in reference to a question
>>from a client. Thanks for your help!
> I would need one of the authors to substantiate where in the JSP specs
> they see the support for the assertion that multiple instances are
> allowed.  I cannot find any evidence to support this in the JSP 1.2
> specification (which the current edition purports to cover).
> Further, I'm *very* skeptical about any claim that multiple instances of
> the servlet running behind your JSP page would actually provide any
> performance benefits, even if it were allowed by the specification.

Servlet Specification p22-23
SRV2.2 Number of Instances
The servlet declaration which is part of the deployment descriptor of the 
web application containing the servlet, as described in Chapter SRV.13, 
“Deployment Descriptor”, controls how the servlet container provides 
instances of the servlet. For a servlet not hosted in a distributed 
environment (the default), the servlet container must use only one instance 
per servlet declaration. However, for a servlet implementing the
SingleThreadModel interface, the servlet container may instantiate multiple 
instances to handle a heavy request load and serialize requests
to a particular instance."

I took that section of the specification to mean that multiple instances
of servlets can be created iff the SingleThreadModel interface is implemented.

Of course, that's just a reading of the spec and I'm not part of that JSR
so I could be interpreting it incorrectly.  I would be interested in a
clarification though.

	-- jon

Jon Eaves <>

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

View raw message