tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: servlets
Date Thu, 30 Jan 2003 21:02:10 GMT


On Wed, 29 Jan 2003, Erik Price wrote:

> Date: Wed, 29 Jan 2003 07:41:01 -0500
> From: Erik Price <eprice@ptc.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: Re: servlets
>
>
>
> Craig R. McClanahan wrote:
> >
> > On 28 Jan 2003, Felipe Schnack wrote:
> >
> >
> >>Date: 28 Jan 2003 19:26:27 -0200
> >>From: Felipe Schnack <felipes@ritterdosreis.br>
> >>Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> >>To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> >>Subject: RE: servlets
> >>
> >>  So if I have just one <servlet> and <servlet-mapping> in my web.xml
I
> >>have guarantee of one instance, don't I?
> >
> >
> > Yes, as long as the servlet doesn't implement SingleThreadModel.
> >
> > MVC frameworks like Struts, where the controller is a singleton, rely on
> > this.
>
> One /instance/, but many /threads/ .... right?
>

Yes.  That is the main reason that using instance variables to store
per-request state information does not work (there is only one copy) but
using local variables in a method does (there is a copy per thread).

And, as Bill correctly points out, the key issue is one <servlet> element.
You can have as many <servlet-mapping> elements for that servlet as you
like.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message