jsp获取工程上下文路径

<a href="${pageContext.request.contextPath}/index.jsp">返回</a>

 

${pageContext.request.contextPath}的作用是取出部署的应用程序名,这样不管如何部署,所用路径都是正确的。

 

1.scriptlet
<%=request.getContextPath()%>

2.el
${pageContext.request.contextPath}

你可能感兴趣的:(jsp)