首页 > 编程语言 > 详细

java EL表达式pageContext理解

时间:2015-12-16 12:41:12      阅读:340      评论:0      收藏:0      [点我收藏+]

内置11个对象

pageContext、pageScope 、requestScope 、sessionScope 、 applicationScope 
param  、paramValues 、header 、headerValues 、 cookie 、initParam 


先判断本身是否有get方法取值 如果没有 就走 getAttribute方法取值


如${pageContext.request.contextPath}


先走pageContext.getRequest(); 如果取不到值 就走 pageContext.getAttribute("request");取值


request.contextPath 同理。


${requestScope.contextPath} 取不到值 是因为 requestScope 本身不是request对象 ,requestScope 

这个对象 反射 getContextPath() 取值 没有这个方法 然后走requestScope.getAttribute("contextPath") 依然没有值 所以返回null

java EL表达式pageContext理解

原文:http://yjm199.blog.51cto.com/4408395/1723707

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!