File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HTTP Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Status 404" Watch "HTTP Status 404" New topic

HTTP Status 404

saheed omotola

Joined: Jun 26, 2011
Posts: 4
i saved the following program inside the classes subdirectory under WEB-INF and the web.xml was saved inside the WEB-INF. I THEREAFTER tryied to RUN the servlet application by typing http://localhost:8080/myApp/servlet/TestingServlet

HERE is my program

the web.xml is as follow:

All i get for this is HTTP STATUS 404

i also typed "http://localhost:8080/testservlet" inside my browser and what i get is "HTTP Status 404 - /testservlet"

please help me out i am very new in web programming.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

It doesn't look like your deployment descriptor has any servlet mappings. Unmapped servlets cannot be invoked.

[Asking smart questions] [About Bear] [Books by Bear]
Abhishek Ralhan
Ranch Hand

Joined: Aug 01, 2010
Posts: 40

You need to put
<servlet-mapping> tags with each of your servlet in your web.xml file. Google for a sample web.xml file. Or it would be best, if you follow any of the startup tutorials available on 'jsp-servlets'.

I came to this world on a Learner's License
I agree. Here's the link:
subject: HTTP Status 404
It's not a secret anymore!