tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: Problem with servlets in Tomcat 4.1.18
Date Mon, 17 Feb 2003 13:52:58 GMT

In recent versions of Tomcat, the default Invoker servlet is disabled by
default for security reasons.  You either have to enable the Invoker servlet
in your web application's web.xml file (not recommended), or explicitly map
your servlet to a URL in your web application's web.xml.

If you decide to use the Invoker, you will want to check the /examples web
app's web.xml file to see how to do that.

If you decide to explicitly map your servlet(s), you would do something like
this in your web.xml file:

<servlet>
  <servlet-name>HelloWorldExample</servlet-name>
  <servlet-class>com.mypackage.HelloWorldExample</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>HelloWorldExample</servlet-name>
  <url-pattern>/HelloWorldExample</url-pattern>
</servlet-mapping>

Note that the order of elements in web.xml is rigidly enforced, you have to
follow the DTD to avoid generating syntax errors.

John

> -----Original Message-----
> From: David.T.Clark@alltelmd.com [mailto:David.T.Clark@alltelmd.com]
> Sent: Sunday, February 16, 2003 7:15 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Problem with servlets in Tomcat 4.1.18
> 
> 
> Hello, I have recently downloaded Tomcat 4.1.18 and I am 
> having a little
> problem getting servlets to work.  After installing a Tomcat 4.1.18 I
> created a directory called test under the webapps directory.  I then
> created directory WEB-INF under test and classes under 
> WEB-INF.  I placed a
> single servlet called HelloWorldExample in the classes 
> directory.  When I
> try to use it I get the 404 error message saying it cannot 
> find it..  The
> really frustrating part is I can copy this directory into the webapps
> directory for Tomcat 4.1.10  or just copy this servlet into any other
> preexisting directory and it works fine.  I can't seem to get 
> any servlets
> to work in any directory I create.  Any ideas?  I have never had this
> problem before in Tomcat. JSPs work fine, just can't get 
> servlets to work.
> Any help would be appreciated.  Thanks
> 
> David T Clark
> Batch/Intranet/Rename Support
> ALLTEL Information Services
> Core Systems (MAD Development Center)
> (904) 854-5095   (Jacksonville)
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message