JSP中获得 Web项目名的方法

JSP中取得 Web项目名的方法JSP中取得 Web项目名的方法:?方法一:%request.getContextPath%?方法二:${pag

JSP中取得 Web项目名的方法

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

?

方法一:

<%=request.getContextPath%>

?

方法二:

${pageContext.request.contextPath}

?

推荐使用方法二.