tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Ford <>
Subject Re: Newbie needing help in deploying servlet
Date Tue, 06 Jan 2004 23:06:33 GMT

Try this;

In your server.xml, add this context to the Host element:

<Context path="/testapp" docBase="/webapps/testapp"
                         reloadable="true" crossContext="true">

                   <Logger className="org.apache.catalina.logger.FileLogger"
                        prefix="localhost_testapp_log." suffix=".txt"
                        timestamp="true" />


Create your web.xml in testapp/WEB_INF as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"


   <display-name>test app</display-name>
      My test web application.







Shutdown and restart Tomcat then direct your browser to:  

(If you want your URL to be .../servlet/form.html, replace the asterisk 
with the word servlet in the servlet-mapping element of the testapp 
web.xml file.)

David wrote:

> I'm trying tomcat-4.1.24 out and have it up and running ok. But when I 
> try to deploy a new servlet it is not seen (404) by tomcat. I have it 
> like this:
> $CATALINA_HOME/webapps/testapp/form.html
> $CATALINA_HOME/webapps/testapp/WEB-INF/classes/Testservlet.class
> I can access the form.html-page on 
> http://localhost:8080/testapp/form.html but not the servlet on 
> http://localhost:8080/testapp/servlet/Testservlet. If I put the class 
> in $CATALINA_HOME/examples/WEB_INF/classes/ it works ok.
> I've restarted tomcat, tried it with and without a web.xml in WEB-INF, 
> tried to add it as a <Context> in server.xml but I still just gets 
> that awful 404...
> Could someone give me any hints please?
> regards
> /David
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message