aspose file tools
The moose likes JSP and the fly likes Resource not found Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 56204
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56204
    
  13

The context path should be fetched using ${pageContext.request.contextPath}
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Resource not found
 
Similar Threads
HTTP Status 404 The requested resource is not available
ssl with Tomcat
Switching form action based upon radio selection
HTTP Status 405 - HTTP method POST is not supported by this URL.
not getting responce from Servlet