Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

File not found error

 
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)



 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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 VI Editor Redhat
  • 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.
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic