This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes executing servlets in Tomcat 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 » Servlets
Bookmark "executing servlets in Tomcat" Watch "executing servlets in Tomcat" New topic
Author

executing servlets in Tomcat

Yell Srik
Ranch Hand

Joined: Mar 10, 2004
Posts: 61
Hi,
i need clarification regarding executing servlets in Eclipse and Tomcat
i have installed Eclipse 2.1.2 on my Linux machine in the path:
opt/Eclipse.
i am using Tomcat 5 to run servlets and have installed tomcat
in the path opt/tomcat. also i am using Sysdeo Tomcat Plug-in for
Eclipse.
now i have written a HTML program that contains a form with a
simple textbox. once the user enters his name and clicks on the submit
button, the result is his name with a greeting.
i have put my HTML file, program.html in the following location:
/opt/tomcat/webapps/ROOT/program.html
and i have put my servlet file program.java in the location:
/opt/tomcat/webapps/ROOT/WEB-INF/classes/WEB-INF/classes/HelloServlet.
class
now when i open my Mozilla browser and type:
http://localhost:8080/program.html it works fine and get my form, but
when i enter a name and click on the submit button, i get the message
as:
HTTP Status 404
the requested resource is not avaialble
i am really unable to figure out what might be the problem.
please help.thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
This is a common problem - do a search for 404 to see LOTS of discussions. A short summary:
1. ALWAYS put your servlet class and all auxiliary classes in a package
2. NEVER use a url with /servlet/
3. LEARN how to configure the web.xml file according to the servlet API
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executing servlets in Tomcat
 
Similar Threads
Head First Servlet JSP: BeerSelect example: requested resource not available
Tomcat6 and Java Beans
my first servlet please help.
500 internal server error
Having trouble getting Tomcat up and running