简单基础路径配置(单用JSP)EASYUI
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@page isELIgnored="false"%> <% String path=request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; // System.out.println(basePath); %> <head> <meta charset="UTF-8"> <base href="<%=basePath%>"></base> <%-- <c:set var="ctxt" value="${pagecontext.request.contextpath}"></c:set> --%> <link id="easyuiTheme" rel="stylesheet" type="text/css" href="<%=basePath%>/frame/comp/easyui/themes/default/easyui.css" /> <script type="text/javascript" src="<%=basePath%>/frame/comp/easyui/jquery.min.js"></script> <script type="text/javascript" src="<%=basePath%>/frame/comp/easyui/jquery.easyui.min.js"></script> <script type="text/javascript"> if (!localStorage.getItem("accessToken")) {//å¤çè·¨åçé®é¢ if (getQueryString('accessToken')) { localStorage.accessToken = getQueryString('accessToken'); } } $.ajaxSetup({ data : { "accessToken" : localStorage.getItem("accessToken") == null ? "" : localStorage.getItem("accessToken") } }); function getQueryString(name) {//è·å请æ±åæ° var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } </script>