首先来看Servlet的相关接口

javax.servlet.Servlet

 1 /**
 2  * A servlet is a small Java program that runs within a Web server.
 3  * Servlets receive and respond to requests from Web clients,
 4  * usually across HTTP, the HyperText Transfer Protocol. 
 5 **/
 6 //javax.servlet.Servlet接口
 7 public interface Servlet {
 8     //servlet容器会保证servlet实例化后开始服务前调用init方法
 9     public void init(ServletConfig config) throws ServletException;
10     
11     public ServletConfig getServletConfig();
12     
13     public void service(ServletRequest req, ServletResponse res)
14     throws ServletException, IOException;
15 
16     public String getServletInfo();
17     //servlet容器关闭时被调用,tomcat的shutdown.bat
18     public void destroy();
19 }
View Code

相关文章:

  • 2021-06-03
  • 2021-05-01
  • 2021-07-06
  • 2021-09-02
  • 2021-05-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-07-13
  • 2019-08-22
  • 2022-02-02
  • 2021-10-18
相关资源
相似解决方案