<%
String WEB_APP = request.getContextPath();
request.setAttribute("WEB_APP", WEB_APP);
%>
例如:
你的地址为:http://localhost:8080/project_web/homePage/createExcel.do;
<a href="${WEB_APP}/homePage/createExcel.do">生成excel</a>相当于
<a href = "project_web/homePage/createExcel.do">生成excel</a>