request.getAttribute() session.getAttribute() application.getAttribute() 的getAttribute方法有区别这几个对象的getAttribute()方法有没有区别呢?作用域有什么区别

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 01:34:38
request.getAttribute() session.getAttribute() application.getAttribute() 的getAttribute方法有区别这几个对象的getAttribute()方法有没有区别呢?作用域有什么区别

request.getAttribute() session.getAttribute() application.getAttribute() 的getAttribute方法有区别这几个对象的getAttribute()方法有没有区别呢?作用域有什么区别
request.getAttribute() session.getAttribute() application.getAttribute() 的getAttribute方法有区别
这几个对象的getAttribute()方法有没有区别呢?作用域有什么区别

request.getAttribute() session.getAttribute() application.getAttribute() 的getAttribute方法有区别这几个对象的getAttribute()方法有没有区别呢?作用域有什么区别
request的Attribute是一次请求里的参数,仅属于当前请求;
session的Attribute是一个会话里的参数,也就是页面没有关闭前或者页面关闭后session超时你所有请求保存的参数
application的Attribute是服务端的参数,也就是服务器关闭前,所有请求保存的参数
所以一般情况application>session>request 也就是说后者能拿到的通常前者都能拿到.