当前位置: 移动技术网 > IT编程>开发语言>JavaScript > JSP九大内置对象

JSP九大内置对象

2018年01月02日  | 移动技术网IT编程  | 我要评论

JSP九大内置对象

内置对象
request 请求对象
response 响应对象

session

会话对象
application 应用程序对象
pageContext 页面上下文对象
config 配置对象
exception 异常对象
page 页面对象
out 输出对象

Request, Session, Application的区别

  • 相同点

都可以储存属性,属性名可以相同但有 优先级 (Requset>Session>Application)

application.setAttribute("msg",message);    //setAttribute("属性名",属性值);
session.setAttribute("msg",message);
request.setAttribute("msg",message);
//当页面使用EL表达式    ${msg}    时,显示的是request的属性值
  • 不同点

Request中储存属性数据仅仅在一个请求中可用

Session中储存的属性数据在Web项目的会话有有效期内可用

Application中储存的属性数据在整个Web项目可用,有效期最长,范围最广

 

本文地址:https://blog.csdn.net/xx1517338/article/details/107385484

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网