This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Tomcat and the fly likes HTTP 404 Servlets do not run Tomcat 5.0. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP 404 Servlets do not run Tomcat 5.0." Watch "HTTP 404 Servlets do not run Tomcat 5.0." New topic

HTTP 404 Servlets do not run Tomcat 5.0.

mallika arora

Joined: Aug 02, 2007
Posts: 5
I am trying some examples from Head First Servlet book. I have J2SDK 1.4.2_13 installed with Tomcat 5.0. HTML page opens fine when I do http://localhost:8080/Beerv1/form1.html but when this HTML page calls Servlet, it gives HTTP status 404 error.

Here is what's in web.xml:

<web-app xmlns="" xmlns:xsi="" xsi:schemaLocation=" web-app_2_4.xsd" version="2.4">
<servlet-name>Ch3 Beer</servlet-name>

<servlet-name>Ch3 Beer</servlet-name>

Here is Servlet code:

package com.example.web;
import javax.servlet.*;
import javax.servlet.http.*;

public class BeerSelect extends HttpServlet

public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException
PrintWriter out=response.getWriter();
out.println("Beer Selection Advice<br>");
String c = request.getParameter("color");
out.println("<br>Got beer color" + c);

This is HTML page calling Servlet:

<h1 align="center">Beer Selection Page</h1>
<form method="POST" action="">Select beer characteristics<p>
Color:<select name="color" size="1"
<input type="SUBMIT"

Please advice. Is there any Tomcat settings that need to be changed?
I agree. Here's the link:
subject: HTTP 404 Servlets do not run Tomcat 5.0.
jQuery in Action, 3rd edition