码迷,mamicode.com
首页 > 编程语言 > 详细

java EL表达式pageContext理解

时间:2015-12-16 12:42:40      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:pagecontext

内置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理解

标签:pagecontext

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!