Fork me on GitHub

${pageContext.request.contextPath}

${pageContext.request.contextPath}样是通过 get方法去取的,先pageContext.getRequest()得到HttpServletRequest对象,再调用 HttpServletRequest的getContextPath方法

作用是取出部署的应用程序名,这样不管如何部署,所用路径都是正确的。

El表达式的写法:${pageContext.request.contextPath}

jsp的写法:<%=request.getContextPath()%>

posted @ 2015-10-11 16:01  ZZZZW  阅读(188)  评论(0编辑  收藏  举报
AmazingCounters.com