servlet生命周期

servlet生命周期分为 init()初始化,service()服务,destroy()销毁。
servlet 生命周期及doget(),dopost()用法
在web.xml里面配置
servlet 生命周期及doget(),dopost()用法

无论servlet服务启动多少次,init()初始化只运行一次
servlet 生命周期及doget(),dopost()用法
可以通过 getRemoteAddr() 方法获取访问主机的IP地址

doget() dopost()

servlet 生命周期及doget(),dopost()用法
get和post都能提交数据,通过get提交的数据有大小的限制,post提交数据没有数据大小的限制

servlet 生命周期及doget(),dopost()用法
在表单中可选择提交数据的方式(get或post),使用get方法地址栏中显示传输的内容,使用post方法则不会显示

servlet 生命周期及doget(),dopost()用法
servlet 生命周期及doget(),dopost()用法

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2022-01-05
  • 2021-04-09
  • 2022-01-09
  • 2022-01-16
  • 2022-01-11
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2021-07-20
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案