那位朋友能否详细讲解一下servlet的生命周期?谢谢!

lci21 2002-07-24 07:14:19
那位朋友能否详细讲解一下servlet的生命周期?谢谢!
...全文
41 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Patrick_DK 2002-07-24
  • 打赏
  • 举报
回复
Normally, WebLogic Server initializes a servlet when the first request is made for the servlet. Subsequently, if the servlet is modified, the destroy() method is called on the existing version of the servlet. Then, after a request is made for the modified servlet, the init() method of the modified servlet is executed.

When a servlet is initialized, WebLogic Server executes the init() method of the servlet. Once the servlet is initialized, it is not initialized again until you restart WebLogic Server or the servlet code when the servlet is modified. If you choose to override the init() method, your servlet can perform certain tasks, such as establishing database connections, when the servlet is initialized.
qiyao 2002-07-24
  • 打赏
  • 举报
回复
servlet一般是容器决定。。。

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧