JSP中取得 Web项目名的方法:

 

方法一:

<%=request.getContextPath%>

 

方法二:

${pageContext.request.contextPath}

 

推荐使用方法二.