1. Servlet的生命周期

生命全过程

加载ClassLoader

实例化 new

//客户端第一次请求的时候,只new一次

初始化init(ServletConfig)

处理请求service do Get doPost

退出服务destroy()

只有一个对象

API中的过程

init()//只执行一次,第一次初始化的时候

public void init(ServletConif config) throws ServletException

service()

public void service(ServletRequest req, ServleteResponse res) throws ServletException, IOException

destroy() //webapp退出时候

public void destroy()

相关文章:

  • 2021-11-14
  • 2021-07-15
  • 2022-12-23
  • 2021-08-19
  • 2021-09-16
  • 2022-01-07
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2022-01-08
  • 2021-07-02
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-06-05
相关资源
相似解决方案