erik morton wrote:

> The 2.2 Servlet spec says that the container must keep only one instance of a
> Servlet per Web application [...]

Hi :-)  I just add a note: with jakarta-tomcat-4.0-b1/2/3(standalone, J2SE1.3,
winnt40):

- if we don't define any servlet-defination in WEB-INF/web.xml, now there will be
  only-one instance of MyServlet, and, normally(please see reference email),  I can

  invoke it by the  following:
  http://xxx.xxx.xxx.xxx/mywebapp/servlet/MyServlet

- if we define m servlet-definations in WEB-INF/web.xml, now after these m
  servlet-definations have all been invoked by
  "<load-on-startup>1</load-on-startup> or invoking-by-client or ..."  , there
   will be m+1 instances of MyServlet(m new, 1 old), the m new instances of
   MyServlet can have different init parameters which can be read with
   this.getInitParameter(...).



refrence email from TOMCAT-USER List:

</good-email haha>
The Servlet Spec doesn't require a /servlet/ mapping, but that's what
everyone is used to, so I think the Tomcat developers put it in as a
default. In the server.xml file there is a RequestInterceptor that handles
requests to /servlet/:

(server.xml)
<!-- Non-standard invoker, for backward compat. ( /servlet/* )
       You can modify the prefix that is matched by adjusting the
        "prefix" parameter below.  Be sure your modified pattern
        starts and ends with a slash.

        NOTE:  This prefix applies to *all* web applications that
        are running in this instance of Tomcat.
-->
<RequestInterceptor
    className="org.apache.tomcat.request.InvokerInterceptor"
    debug="0" prefix="/servlet/" />

I believe this is how requests to /examples/servlet/HelloWorldExample are
getting mapped to /WEB-INF/classes/HelloWorldExample.class. For a deeper
explanation, you need to look at the code in
org.apache.tomcat.request.InvokerInterceptor.

--jeff

</good-email haha>




Bo
Apr.27, 2001

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to