jsp中获取当前项目名称

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

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

方法2: 使用EL表达式 ${pageContext.request.contextPath}

posted @ 2017-03-20 13:56  习惯沉淀  阅读(1031)  评论(0编辑  收藏  举报