File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet Access error" Watch "Servlet Access error" New topic

Servlet Access error

pengpeng lin

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"/>



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

Can anybody help me! Thanks a lot
pengpeng lin

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

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
Have you tried LearnNowOnline?
subject: Servlet Access error