-----Original Message-----
From: Randy Layman [mailto:[EMAIL PROTECTED]]
<snip>

> -----Original Message-----
> From: Nikola Milutinovic [mailto:[EMAIL PROTECTED]]

<snip>

> If Tomcat gets two requests, handled by the same servlet, 
> will the same instance of that servlet handle it?
Yes.  Tomcat will always create exactly one instance of a servlet
for each unique URL that can access it (i.e. two servlet mappings 
equals two instances).

Doesn't this depend upon how the servlet is scoped?  Tomcat will compile one
jsp per *.jsp file but instantiates the servlet differently according to the
servlet's scope being either application, session, or request.

Randy is explaining application scope.  You get one instance of the servlet
and state is maintained across all accesses.

Session scope will maintain state for the duration of an http session and
request scope will give you a new servlet for each request with no memory
shared (and no shared memory) between requests.

>From what I understand of the Servlet Spec. a servlet must be contained
within one instance of a JVM (because of concurrency issues) but, that is
not related to the servlet scope which pertains to the semantics of your web
application.

That's kinda how I've been understanding it.  Please correct me if I'm
wrong.

-Mark

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to