Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: Does not run the classes

Neale Rudd

2004-12-21


Hi,

A servlet won't work automatically in this way with the standard install of
Tomcat.

You will need to do one of the following:

a) in conf/web.xml, enable the InvokerServlet entry by uncommenting in
b) add the invoker servlet manually to the web.xml file in /rma/WEB-INF
c) add a <servlet> and <servlet-mapping> entry in your web.xml file (this
is the preferred method). You can check the webapps/servlet-examples/WEB-
INF/web.xml file for an example of how to do this.

eg, add this to your web.xml

  <servlet>
    <servlet-name>Testin</servlet-name>
    <servlet-class>Testin.class</servlet-class>
  </servlet>

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

The first part, says that the "Testin" servlet class is "Testin.class".

The second part says that when you access /servlet/Testin, under your web
app /rma, then it should use the Testin servlet.

Hope that helps,
Neale Rudd
metawerx java hosting
http://www.metawerx.net

___________________________________________________________________________
To unsubscribe, send email to listserv@(protected)
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
©2008 junlu.com - Jax Systems, LLC, U.S.A.