Tomcat Beginner problem
[nobr]Hi, I am a Beginner of learning Tomcat & JSP. According tutorial, I follow the code and found it can't work,
I place the BasicServlet.java into C:\jakarta-tomcat-5.0.28\webapps\ROOT\
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
publicclass BasicServletextends HttpServlet{
publicvoid init(ServletConfig config)
throws ServletException{
super.init(config);
}
publicvoid doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>BasicServlet</title></head>");
out.println("<body>");
out.println("Your request method was " + request.getMethod()
+"\n");
out.println("</body></html>");
out.close();
}
publicvoid doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>BasicServlet</title></head>");
out.println("<body>");
out.println("Your request method was " + request.getMethod()
+"\n");
out.println("</body></html>");
out.close();
}
public String getServletInfo(){
return"BasicServlet Information";
}
}
A html file create into C:\jakarta-tomcat-5.0.28\webapps\ROOT\BasicServlet.html
<HTML>
<HEAD>
<TITLE>
BasicServlet
</TITLE>
</HEAD>
<BODY>
<FORM
ACTION=http://localhost:8080/BasicServlet
METHOD=POST>
<BR><BR>
press Submit Query to launch servlet BasicServlet
<BR><BR>
<INPUT TYPE=submit>
<INPUT TYPE=reset>
</FORM>
</BODY>
</HTML>
When I browse the html file, and click "Submit Query", there come "error" display, What is the happen going on? Anyone can try me out, thank you.[/nobr]

