日期:2014-05-20 浏览次数:20867 次
public class TestServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * Default constructor. */ public TestServlet() { TODO Auto-generated constructor stub super(); } /** * @see Servlet#init(ServletConfig) */ public void init(ServletConfig config) throws ServletException { // TODO Auto-generated method stub System.out.println("Hello!"); } /** * @see Servlet#destroy() */ public void destroy() { // TODO Auto-generated method stub } /** * @see Servlet#getServletConfig() */ public ServletConfig getServletConfig() { // TODO Auto-generated method stub return null; } /** * @see Servlet#getServletInfo() */ public String getServletInfo() { // TODO Auto-generated method stub return null; } /** * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response) */ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub System.out.println("doGet"); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } }