1 19 20 package org.test; 21 22 import java.io.*; 23 import java.net.*; 24 25 import javax.servlet.*; 26 import javax.servlet.http.*; 27 28 32 public class NewServlet extends HttpServlet { 33 34 38 protected void processRequest(HttpServletRequest request, HttpServletResponse response) 39 throws ServletException, IOException { 40 response.setContentType("text/html;charset=UTF-8"); 41 PrintWriter out = response.getWriter(); 42 52 out.close(); 53 } 54 55 60 protected void doGet(HttpServletRequest request, HttpServletResponse response) 61 throws ServletException, IOException { 62 processRequest(request, response); 63 } 64 65 69 protected void doPost(HttpServletRequest request, HttpServletResponse response) 70 throws ServletException, IOException { 71 processRequest(request, response); 72 } 73 74 76 public String getServletInfo() { 77 return "Short description"; 78 } 79 } 81 | Popular Tags |