日期:2014-05-18 浏览次数:20832 次
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ response.setContentType("text/html"); PrintWriter out=response.getWriter(); out.println("<html>"); out.println("<head><title>HiddenFieldServlet</title></head>"); out.println("<body>"); out.println("<form action = "+"\"http://localhost:8080/servlet/HiddenFieldServlet\" method=\"post\">"); out.println("<input type =\"hidden\" name=" + "\"user\" value=\"javes\">"); out.println("<input type =\"hidden\" name=" + "\"session\" value = \"12892\">"); out.println("<input type =\"hidden\" name=" + "\"movie\" value=\"Happy Gilmore\">"); out.println("<input type =\"hidden\" name=" + "\"movie\" value=\"SO I Married an Axe Murderer\">"); out.println("<input type = \"hidden\" name=" + "\"movie\" value=\"Jaws\">"); out.println("<input type = \"submit\" value =" + "\"submit\">"); out.println("</form>"); out.println("</body><html>"); out.close(); }