tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arion" <>
Subject Re: How can I change the servlet path?
Date Wed, 01 Mar 2000 09:16:16 GMT

I have read the specification, but I am still confused about some of the

Is the reason for the servlet URL be <CONTEXT>/servlet/ because servlet is its
resource name and we are going to get this resource under this context? Is this
necessary meaning that we have no way to change the name?

If I want to use different name, must I specific the name for each servlet
using servlet-mapping?



"Craig R. McClanahan" wrote:

> Arion wrote:
> > Hi!
> >
> > The default local path for CONTEXT is <CONTEXT docbase>/web-inf/classes,
> > am I right? How can I override the setting say <CONTEXT
> > docbase>/servlet?
> >
> You are confusing the class path for a context (used to locate all Java
> classes referenced by a web application, not just servlet classes) with the
> URL that is mapped to a particular servlet.
> The 2.2 servlet specification defines that all classes under
> WEB-INF/classes (and all JAR files under WEB-INF/lib) become part of the
> class path for a particular context.  However, this has nothing to do with
> how you access servlets found in those directories via a URL.
> If you use a URL like "/{context-path}/servlet/xxxxx", Tomcat looks for a
> class named "xxxxx" in one of the above two locations, or along the system
> class path if not found there.  It follows the usual Java rules for
> resolving classes that are inside packages.
> In addition, you can map a servlet to a specific path to a specific servlet
> using <servlet-mapping> element in the web.xml file.  Again, the class
> itself is located by looking in WEB-INF/classes, WEB-INF/lib/*.jar, or
> along the system class path.  See the servlet 2.2 specification for more
> details and examples.
> >
> > Thank you
> >
> > Arion
> >
> Craig McClanahan
> PS:  Tomcat 3.0 had a bug that prevented classes in WEB-INF/lib/*.jar from
> being found.  This has been fixed in more recent releases.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message