wood burning stoves*
The moose likes Tomcat and the fly likes Servlet Access error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet Access error" Watch "Servlet Access error" New topic
Author

Servlet Access error

pengpeng lin
Greenhorn

Joined: Dec 24, 2005
Posts: 26
Hi,everybody.I want to ask a question about Servlet access.

I added a web app to the "webapps" directory and restart the Tomcat. When I type the URL:http://localhost:8080/helloapp/showpathtest it give me a 404 error.

Here is the configuration of server.xml and web.xml
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="/helloapp" docBase="helloapp" debug="0" reloadable="true"/>
<Host>

<servlet>
<servlet-name>showpathtest</servlet-name>
<servlet-class>mypack.ShowPathTest</servlet-class>
</servlet>

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

and the ShowPathTest.class is under the WEB-INF/classes/mypack directory.


Can anybody help me! Thanks a lot
pengpeng lin
Greenhorn

Joined: Dec 24, 2005
Posts: 26
Can anybody help me? I'm new to Tomcat.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Where did you put the servlet and servlet-mapping entries?
Hopefully in your web.xml file.
Where did you put your web.xml file?

You didn't need to edit server.xml.
Tomcat will automatically deploy apps that it finds in the webapps directory.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
 
subject: Servlet Access error