Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File not found error

 
Cary Tanner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What app server are you using?
 
Cary Tanner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletExec
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic