tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Kilbride" <j...@kilbride.com>
Subject Re: A couple of questions
Date Fri, 13 Apr 2001 19:04:02 GMT
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

----- Original Message -----
From: "Lu, Spencer" <slu@spaceworks.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, April 13, 2001 11:37 AM
Subject: RE: A couple of questions


> OK, I have just read the Servlet Specification 2.2, and it does not answer
> my first question, which was:
>
> When I go to the Servlet Examples page
> (http://localhost:8080/examples/servlets/index.html), there is a link that
> executes the Hello World servlet.  This link is
> http://localhost:8080/examples/servlet/HelloWorldExample.  How does Tomcat
> know that when it sees "/examples/servlet/" in the URL, it is supposed to
> look in the examples/WEB-INF/classes directory for the
> HelloWorldExample.class file?  I haven't been able to find anything in the
> server.xml or web.xml files that shows how this is configured.
>
> I see no servlet mappings in any of the configuration files that maps a
> servlet to "/examples/servlet/HelloWorldExample".
>
> Please tell me how this is set up.
>
> Thanks,
> Spencer
>
> -----Original Message-----
> From: Filip Hanik [mailto:mail@filip.net]
> Sent: Wednesday, April 11, 2001 7:37 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: A couple of questions
>
>
> first things first,
> you will have 90% of your questions answered by reading the servlet
> specification from Sun.
> this answers question 1 for you
>
> > 2) Would it be possible for me to place my application in a completely
> > separate directory tree and not in a war file?  Or does it have to be in
a
> > war file in the webapps directory?
>
> yes, you will just have to setup classpaths etc properly for servlets and
> other classes.
> The server.xml file allows you to configure other contexts outside of the
> webapps directory.
>
> Filip
>
>
>
> ~
> Namaste - I bow to the divine in you
> ~
> Filip Hanik
> Software Architect
> filip@filip.net
> www.filip.net
>
> > -----Original Message-----
> > From: Lu, Spencer [mailto:slu@spaceworks.com]
> > Sent: Wednesday, April 11, 2001 4:29 PM
> > To: 'tomcat-user@jakarta.apache.org'
> > Subject: A couple of questions
> >
> >
> > Hi,
> >
> > I've recently installed Tomcat 3.2.1 (win32) on my computer.  I'm
> > trying to
> > understand how certain things are configured, and I have a couple of
> > questions:
> >
> > 1) When I go to the Servlet Examples page
> > (http://localhost:8080/examples/servlets/index.html), there is a link
that
> > executes the Hello World servlet.  This link is
> > http://localhost:8080/examples/servlet/HelloWorldExample.  How does
Tomcat
> > know that when it sees "/examples/servlet/" in the URL, it is supposed
to
> > look in the examples/WEB-INF/classes directory for the
> > HelloWorldExample.class file?  I haven't been able to find anything in
the
> > server.xml or web.xml files that shows how this is configured.
> >
> > 2) Would it be possible for me to place my application in a completely
> > separate directory tree and not in a war file?  Or does it have to be in
a
> > war file in the webapps directory?
> >
> > Thanks for your help,
> > Spencer
> >
> >
>


Mime
View raw message