I found that if I don't have the <context> in server.xml it still works. Is
that how it's supposed to be?

thanks - dave


----- Original Message -----
From: "p niemandt" <[EMAIL PROTECTED]>
To: "Tomcat Users" <[EMAIL PROTECTED]>
Sent: Wednesday, March 19, 2003 6:31 PM
Subject: Re: Simple servlet won't display


> aah: Where to start ;-)
>
> {list users feel free to correct ...
>
> 1. server.xml
> You need to configure your web application in the server xml. This is in
> an element <Context /> which defines where your application resides, and
> optionally any resources your web app uses.
>
> 2. web.xml
> You need to map your web application to it's implementation. It's not
> enough to just state your web descriptor {Like your post shows}, you
> will also need something like
>
>         <!-- Map requests to servlet -->
>         <servlet-mapping>
>                 <servlet-name>ServletName</servlet-name>
>                 <url-pattern>/*</url-pattern>
>         </servlet-mapping>
>
> after ALL the <servlet /> definitions.
>
> 3. The implementation: You will need to compile your servlet and place
> the implementation classes under your web app directory ... {which it
> seems you did correctly }
>
> something like
> $CATALINA_HOME/webapps/yourwebapp/WEB-INF/classes
>
>
> This all said, there are a lot of different ways of doing the above,
> packaging everything in a WAR file comes to mind.
>
> You would probably need to do quite a bit of reading up on it first,
> it's not the easiest of things to come to grips with: The learning curve
> is quite steep, but well worth it.
>
> Hope this helps somewhat, good luck!
> Paul
>
>
>
> On Thu, 2003-03-20 at 01:07, David Thielen wrote:
> > Hi;
> >
> > I am trying to get a very simple servlet to display (the example ones
work fine). This is my web.xml
> > file:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> > 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
> >
> > <web-app>
> >     <display-name>Windward Utilities</display-name>
> >     <servlet>
> >         <servlet-name>hello</servlet-name>
> >         <servlet-class>HelloWorldExample</servlet-class>
> >     </servlet>
> > </web-app>
> >
> > My directory is:
> > C:\Program Files\Apache Group\Tomcat 4.1\webapps\utils\WEB-INF\web.xml
> > C:\Program Files\Apache Group\Tomcat
> > 4.1\webapps\utils\WEB-INF\classes\HelloWorldExample.*
> > C:\Program Files\Apache Group\Tomcat
> > 4.1\webapps\utils\WEB-INF\classes\LocalStrings*.properties
> >
> > When I put in the url http://localhost:8080/servlet/hello
> >
> > I get:
> >
> > HTTP Status 404 - /servlet/hello
> >
>
> --------------------------------------------------------------------------
--
> > ----
> >
> > type Status report
> >
> > message /servlet/hello
> >
> > description The requested resource (/servlet/hello) is not available.
> >
> >
>
> --------------------------------------------------------------------------
--
> > ----
> >
> > Apache Tomcat/4.1.18
> > any ideas?
> >
> > thanks - dave
> --
> p niemandt <[EMAIL PROTECTED]>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to