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()用法

相关文章: