发布网友 发布时间:2024-10-23 21:51
共2个回答
热心网友 时间:2024-10-26 06:19
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the POST method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
这是servlet 向外跳转的一个参考,你可以看看 http://panlianghui-126-com.iteye.com/blog/730262
热心网友 时间:2024-10-26 06:21
用流往外写