aspose file tools*
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
Author

Http Status 404

praveen kumar t
Greenhorn

Joined: Jun 30, 2012
Posts: 3
hi,
I have installed tomcat version 7 and i'm able to access the homepage by specifying http://localhost:8080 in the browser
But when i try to access the html which i have created in my webapp, i'm getting the following error
HTTP Status 404 - /TestServlet/myIndex.html

type Status report

message /TestServlet/myIndex.html

description The requested resource (/TestServlet/myIndex.html) is not available.

Apache Tomcat/7.0.26

TestServlet is the name of the app

what could have gone wrong ???
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
The most likely cause is that Tomcat does not recognize the TestServlet directory as a webapp because the directory structure is not correct.

Look at the directory structure under ROOT or the examples webapp for clues.

Be sure that the directory named WEB-INF is all caps and that it contains a web.xml deployment descriptor.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

See the ServletsFaq. This is addressed with the very first entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
praveen kumar t
Greenhorn

Joined: Jun 30, 2012
Posts: 3
William Brogden wrote:The most likely cause is that Tomcat does not recognize the TestServlet directory as a webapp because the directory structure is not correct.

Look at the directory structure under ROOT or the examples webapp for clues.

Be sure that the directory named WEB-INF is all caps and that it contains a web.xml deployment descriptor.

Bill


Thanks for Reply Bill

I have created the directory structure From eclipse IDE as new ->dynamic web project

Following is the directory structure
TestServlet
src
FirstServlet.java
WebContent
index.html
input.html
WEB-INF
web.xml

The server is up and running wnen started from IDE and i'm able to access index.html and map it to input.html
where I enter some text and submit .
And the form action="/FirstServlet" which should map to servlet where i'm accessing the form data using getParameter is not running.
I'm getting the
HTTP Status 404 - /FirstServlet

type Status report

message /FirstServlet

description The requested resource (/FirstServlet) is not available.

error..

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Have you read the FAQ entry and made sure that you've done each item listed there?
praveen kumar t
Greenhorn

Joined: Jun 30, 2012
Posts: 3
Bear Bibeault wrote:Have you read the FAQ entry and made sure that you've done each item listed there?


Yes i have.
And i'm able to run the app in IDE now, trying to run it in browser.
Vicky Rajawat
Greenhorn

Joined: Jun 16, 2012
Posts: 9
It could've something to do with DD infact I think it has. Check the <web-app x x x> tag. Someone had the same problem, I think it has something to do with little change. I mean the tag you are using probably would've been valid earlier. So change x x and x accordingly
abhishek jethwani
Greenhorn

Joined: Aug 11, 2006
Posts: 14
if its working in IDE but not in explorer then it could be directory path issue.

you can check with another option create war file deploy it on server directly and check if hows its responding.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Http Status 404