this is my first program on servlet and i am getting some problem.I am using tomcat 5.5 for servlet container(server), three files associated with this servlet are
home.html
<html>
<head>
</head>
<body>
<form action="trialpath">
<input type=submit values="aa" name=ab/>
</form></body></html>
firstservlet.java
import javax.servlet.*;
public class firstservlet extends GenericServlet
{
public void service(ServletRequest req,ServletResponse)throws IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
pw.println("this is for testing");
}
}
web.xml file
<web-app>
<servlet>
<servlet-name>trial</servlet-name>
<servlet-class>firstservlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>trial</servlet-name>
<url-pattern>/trialpath</url-pattern>
</servlet-mapping>
</web-app>
now my servlet file is compiled successfully and i have pasted these three files in the this pattern of tomcat home directory
1)webapps/root/home.html
2)webapps/root/firstservlet.java
3.webapps/root/web-inf/web.xml
4)webapps/root/web-inf/classes/firstservlet.class
1
after doing these when i am try to run my servlet program using
http://localhost:8080/home.html"
i am getting a message as error page with "Not found
The requested URL /home.html was not found on this server" rather than getting the right answer.
i am trying my best not able to get the problem please help me. thanks