wood burning stoves*
The moose likes JSP and the fly likes Resource not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Resource not found" Watch "Resource not found" New topic
Author

Resource not found

nandini lagunia
Ranch Hand

Joined: May 05, 2009
Posts: 57
Hi,

I have a html page from where I am trying to call a servlet.

the html page looks like as follows:-




The web.xml file looks like:-



I am usging tomcat 6.
Now when I submit the html form, it ideally should invoke the servlet but I am getting "The requested resource (/servlet/FileUploaderServlet) is not available." instead.
The snapshot of the directory structure of my web application can be found in the attachment.

Can anyone give me any pointers where I am committing the mistake?





[Thumbnail for struct.png]

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

You are not including the context path in the action URL.

P.S. Mapping servlets with a prefix of "/servlet/" looks really amateurish. Why the needless prefix? Also, including the term "Servlet" inthe mapping at all is poor -- it reveals the underlying implementation needlessly. I'd rethink your mapping names.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nandini lagunia
Ranch Hand

Joined: May 05, 2009
Posts: 57
Thanks Bear for the help.

I'll keep your suggestions in my mind.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

The context path should be fetched using ${pageContext.request.contextPath}
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Resource not found
 
Similar Threads
HTTP Status 405 - HTTP method POST is not supported by this URL.
Switching form action based upon radio selection
HTTP Status 404 The requested resource is not available
not getting responce from Servlet
ssl with Tomcat