tags:

views:

50

answers:

0

Possible Duplicate:
unable to connect to server (error-404)

still i am getting same error even after modifying it.

my new servlet:

import java.io.*;
import javax.servlet.*;

/**
 * Servlet implementation class Greetingservlt
 */
public class Greetingservlt extends GenericServlet {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public void service(ServletRequest request,ServletResponse response) throws ServletException,
    IOException
    {
        String name=request.getParameter("t1");
        response.setContentType("text");
        PrintWriter pw=response.getWriter();
        pw.println("<html>");
        pw.println("<body bgcolor=wheat>");
        pw.println("<h1>HELLO " +  name  + "  WELCOME</h1>");
        pw.println("</html>");
        pw.close();

    }
}   

new xml:

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
    version="2.4"> 
 <display-name>My First Web Application</display-name>
<servlet>
<servlet-name>one</servlet-name>
<servlet-class>Greeting.Greetingservlt</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>one</servlet-name>
<url-pattern>http://8080/greetingservlet/greet&lt;/url-pattern&gt;
</servlet-mapping>
</web-app>

My HTML:

<!DOCTYPE greeting SYSTEM "hello.dtd">

<html>
<title>Insert title here</title>
<body BGCOLOR="YELLOW">
<center>
<h1>USER NAME ENTRY SCREEN</h1>
<form action="http://8080/greetingservlet/greet"&gt;
user name<input type="text" name="t1">
<br><br>
<input type="submit" value="get message">
</form>
</center>
</body>
</html>

"greet" is not my jsp name.This is the name given to urlmapping. I also created new package "greeting" at javaresourse-> src folder . My HTML is at directly under greetingservlt folder.

Please help me as soon as possible..... Thank you for your reply.