在JSP页面获取当前项目名称的方法

在JSP页面获取当前项目名称的方法:

  • 方法1: <%= this.getServletContext().getContextPath() %>

  • 方法2: 使用EL表达式(如果不清楚EL表达式是什么,大家可以百度一下)

    ${pageContext.request.contextPath}

猜你喜欢

转载自blog.csdn.net/weixin_44682513/article/details/106430617