Cannot find the servlet--can anyone pls help

Hi,
I am trying to run an example servlet the code is as follows:
Example.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<Title>Example</Title>
</HEAD>
<BODY>
<form action="\example\classes.ShowParameters" method="post">
Name: <input type="textbox" size="10">
Number:<input type="textbox" size="10">
<input type="submit" value="submit">
</form>
</BODY>
</HTML>
ShowParameters.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class ShowParameters extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println( "<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + "</H1>\n" +
"<TABLE BORDER=1 ALIGN=CENTER>\n" +
"<TR BGCOLOR=\"#FFAD00\">\n" +
"<TH>Parameter Name<TH>Parameter Value(s)");
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
out.println("<TR><TD>" + paramName + "\n<TD>");
String[] paramValues = request.getParameterValues(paramName);
if (paramValues.length == 1) {
String paramValue = paramValues[0];
if (paramValue.length() == 0)
out.print("<I>No Value</I>");
else
out.print(paramValue);
} else {
out.println("<UL>");
for(int i=0; i<paramValues.length; i++) {
out.println("><LI>" + paramValues);
out.println("</UL>");
out.println("</TABLE>\n</BODY></HTML>");
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
example.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Welcome </display-name>
<description>
Welcome to Pc Tune Up
</description>
<servlet>
<servlet-name>example.ShowParameters</servlet-name>
<servlet-class>example.ShowParameters</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>example.ShowParameters</servlet-name>
<url-pattern>/Example.html</url-pattern>
</servlet-mapping>
</web-app>
and the servlet is sucessfully compiled..
and i put the classes in the ROOT directory..
The structure is as follows:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\classes\example\ShowParameters.class
and also the java files in the same folder
and i created the jar file and placed it in the lib folder of ROOT.
but when i am trying to run the html file and submit the form it says HTTP:404 FILE NOT FOUND ERROR..
Can anyone please help me where i am going wrong....
Thanks & Regards
Lavanya

[<form action="\example\classes.ShowParameters" method="post">[
this is wrong
change it to
<form action="/Example.html" method="post">
beacause you have specified
<url-pattern>/Example.html</url-pattern>
this is how you map a request to a servlet
its better if you chage it like this
<form action="/Example." method="post">
In web.xml
<url-pattern>/Example</url-pattern>

Similar Messages

Maybe you are looking for

  • ATG Endeca CRS Integration baseline_update.bat fails

    Hi, I have deployed the CRS through cim.bat and after that I am trying to run the following scripts and fails with the below errors. I am able to deploy the dicsover application that comes with the Endeca. Here are the steps I am trying to do after d

  • How to delete the Initialization records in  2LIS_03_BX

    BW3.5 - R/3 4.6c - LO-Cockpit - SCM Implementation - Inventory Management 0IC_C04 InfoCube. I wanted to use 2LIS_03_BX and RSA3 was showing zero records. I ran MCNB to collect records for this extract and it collected 815000 stock records. When I che

  • Old iBook, new Panther

    I dusted off the old Blueberry clamshell, put some more memory in it, and got ready to install 10.3.5 from a gray&white installation disk, which I used on my Pismo. But - the disk is a DVD, and my old iBook has a CD drive ! I don't suppose I can Carb

  • Itunes needs to be updated to sync but ipad is disabled

    My son tried the passcode too many times & disabled my daughters IPad. I plug it in to sync with ITunes it tells me iPad can not be used because it requires iTunes 11.1 or greater. Is there other way to get iTunes to recognize it so we dont have to r

  • Using DB Adapter in BPEL to build a flatfile!!!!!!!!!!!!!!!

    I have couple of oracle tables and want to take data from these tables and build a flatfile and put it on filesystem . Is there a way to build a flatfile using DataBase Adapter in BPEL. Any help is appreciated. Thanks.