java EL表达式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

你可能感兴趣的:(pageContext)