This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes File not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "File not found error" Watch "File not found error" New topic
Author

File not found error

Cary Tanner
Greenhorn

Joined: Feb 08, 2005
Posts: 4
I'm brand new to servlets. I have a homepage, index.html and am trying to link to a servlet and I keep getting:

Error. The file was not found. (servlet name = java146.project2.First146Servlet)



Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What app server are you using?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Cary Tanner
Greenhorn

Joined: Feb 08, 2005
Posts: 4
ServletExec
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Hmm, I'm not familiar with that server but I know that in Tomcat, the invokerServlet is no longer active by default.

This means that you can no longer call servlets the way you are calling them
<p align=center><A HREF="/servlet/java146.project2.First146Servlet">Project2 Servlet</A></p>

You now need to map each servlet explitly in your web.xml file. Because this addresses a security issue, I wouldn't be surprized if ServletExec did the same thing.

Search the documentation for 'servlet-mapping'.

BTW: if you want some examples of mapped servlets you can get some at:
http://simple.souther.us
These are all packaged as war files so you should be able to deploy them pretty quickly to check the mapping issue.
 
GeeCON Prague 2014
 
subject: File not found error