EL表达式{pageContext.request.contextPath}取得绝对路径
具体完成为:先使用pageContext.getRequest()得到HttpServletRequest,然后用HttpServletRequest的getContextPath方法。
其中有2种写法:EL表达式{pageContext.request.contextPath}或者<%= request.getContextPath()%>
本文详细介绍了如何使用EL表达式和HttpServletRequest从页面上下文中获取绝对路径,包括两种实现方式:EL表达式{pageContext.request.contextPath}
EL表达式{pageContext.request.contextPath}取得绝对路径
具体完成为:先使用pageContext.getRequest()得到HttpServletRequest,然后用HttpServletRequest的getContextPath方法。
其中有2种写法:EL表达式{pageContext.request.contextPath}或者<%= request.getContextPath()%>

被折叠的 条评论
为什么被折叠?