javaEE项目中常用的包含上下文路径的代码

<%@page import="java.util.regex.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="com.uudev.framework.util.LoggerUtils" %>
<%@page import="com.uudev.framework.util.Utils" %>
<% //设置contextPath上下文路径 String contextPath = Utils.getContextPath(request); //LoggerUtils.getLogger().warn("contextPath="+contextPath); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + contextPath + "/"; request.setAttribute("contextPath", contextPath); %>
<script> contextPath = '<%=contextPath %>'; jsessionid = '<%=request.getSession().getId() %>'; </script>

你可能感兴趣的:(javaEE项目中常用的包含上下文路径的代码)