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

public class hello2 extends HttpServlet {
   public void service(HttpServletRequest req, HttpServletResponse res) 
   throws ServletException, IOException {
      res.setContentType("text/html");
      PrintWriter out = new PrintWriter(res.getOutputStream());
      out.println("<H1>Hello, " + req.getParameter("name") + "</H1>");
      out.println("GET: <FORM METHOD=GET ACTION=/servlet/hello2>");
      out.println("<INPUT TYPE=TEXT NAME=name><INPUT TYPE=SUBMIT>");
      out.println("</FORM>");
      out.println("POST: <FORM METHOD=POST ACTION=/servlet/hello2>");
      out.println("<INPUT TYPE=TEXT NAME=name><INPUT TYPE=SUBMIT>");
      out.println("</FORM>");
      out.flush();
   }
}