首页 > 其他 > 详细

${pageContext.request.contextPath}

时间:2015-10-11 16:45:35      阅读:164      评论:0      收藏:0      [点我收藏+]

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

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

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

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

${pageContext.request.contextPath}

原文:http://www.cnblogs.com/zzzzw/p/4869431.html

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