hi,
I am using Tomcat 5.5 server, jdk1.5.0_06 version. Operating System is: Windows XP
i have two files:
Hello.htm Hello.java (servlet file)
I have compiled Hello.java and it's compiled perfectly.
now i have to run this. ------------------------------------------------------------------ My File name is: Hello.htm
<html>
<head><title> Introduction </title></head>
<body>
<form method=get action="/temp/Hello">
If you don't mind me asking, what is your name?
<input type=text name="name"><p>
<input type=submit>
</form>
</body>
</html> ------------------------------------------------------------------
My File name is: Hello.java
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
public class Hello extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String name = req.getParameter("name");
out.println("<HTML>"); out.println("<HEAD><TITLE> Hello, " + name + " </TITLE></HEAD>"); out.println("<BODY>"); out.println(" Hello, " + name); out.println("</BODY>"); out.println("</HTML>"); }
public String getServletInfo(){
return "A servlet that knows the name of the person to whom it's " + "saying hello"; } } ---------------------------------------------------------------------
Now problem is where i have to put these three files?
I have put these three files in: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servlets-examples\WEB-INF\classes
but it doesn't work.. with http://localhost:8080/servlet-examples/servlet/Hello
but doesn't work...
i could not reach Hello.htm file.
how to do these...? request for tips.
thanks
Thanks
|