您的位置:首页 > 编程语言 > Java开发

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

2015-08-03 14:41 225 查看
<%@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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: