On Sun, 9 Sep 2001, Charles Webber wrote:

> Date: Sun, 9 Sep 2001 17:30:28 -0700
> From: Charles Webber <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: newbe: class directory question
>
> Ok - I have basically the same question when it comes to Servlets.  I've
> created the proper directory structure for a new web application under
> $TOMCAT_HOME/webapps, placed a new context in server.xml,

You don't actually have to do this, if the directory is under "webapps" --
Tomcat will recognize it automatically.

> and created a
> web.xml file pointing to the servlet class, but still I can't find it
> without using /servlet/ as part of my URL.  How come?
>

Have you got a <servlet-mapping> in your /WEB-INF/web.xml file?

The only way to solve problems like this is details - please post the
directory structure and its contents, the contents of the web.xml file,
and the URL you are trying.  Otherwise, there's no hope of helping you
figure out where you haven't got things quite right.

Craig


> ----- Original Message -----
> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, September 09, 2001 3:21 PM
> Subject: Re: newbe: class directory question
>
>
> >
> >
> > On Sun, 9 Sep 2001, Bo Xu wrote:
> >
> > > Date: Sun, 09 Sep 2001 18:11:11 -0400
> > > From: Bo Xu <[EMAIL PROTECTED]>
> > > Reply-To: [EMAIL PROTECTED]
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: newbe: class directory question
> > >
> > > [EMAIL PROTECTED] wrote:
> > >
> > > > Hi everyone,
> > > >
> > > > I have a question about the directory structure, or maybe a question
> about
> > > > servlets themselves; I'm not sure yet.
> > > >
> > > > 1) Does every class file that I'm going to be using have to be in the
> > > > WEB-INF\classes directory while using Tomcat?
> > > > 2) Do all JSP/Servlet servers/containers have this directory?
> > > >
> > > > THE chad
> > >
> > > only for your first question :-)
> > >
> > > * class can be put in:
> > >     - WEB-INF/classes
> > >           or
> > >     - $CATALINA_HOME/classes
> > >           or
> > >     - $CATALINA_HOME/common/classes
> > >
> > >
> > > * jar can be put in:
> > >     - WEB-INF/lib
> > >          or
> > >     - $CATALINA_HOME/lib
> > >           or
> > >     - $CATALINA_HOME/common/lib
> > >
> > >
> > > good email for you :-)
> > >
> >
> > Just a caution, related to your second question.
> >
> > All servlet containers supporting the Servlet 2.2 or 2.3 specs do indeed
> > support unpacked classes in WEB-INF/classes, or JAR'd classes in
> > WEB-INF/lib.  This is defined in the servlet specification, which can be
> > downloaded from:
> >
> >   http://java.sun.com/products/servlet/download.html
> >
> > and makes useful reading in order to understand what is portable and what
> > is not.
> >
> > Most containers provide mechanisms to make classes available to all web
> > applications, but this is *not* standardized, or even guaranteed to be
> > available.
> >
> > Craig
> >
>
>

Reply via email to