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ZS6S7W8LlJBcMmGvUSFSXZguD4wPjmineobLrzhHqinfwcjIWduTmOJPeljOdukVp4dP1u1bny7Qn/qUk9qUb4l42kIqFNL1KDQqRKqdppjLW4NoYK9ROVJ9xfzfKxyUtwYRwV4jTstbgyjB+ChgADQCDIBGgAHQCDAAGgEG/D+orhtcF6SldAAAAABJRU5ErkJggg==" alt="" />

1.定义一个公共的JSP:首先引入jstl,再定义一个项目的基本路径。

tag.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<c:set var="baseurl" value="${pageContext.request.contextPath}/"></c:set>

 2.其他JSP页面通过静态包含引入上面的JSP内容

<%@ include file="/tag.jsp"%>

3. 也可以将公共的css与js引入连接抽出来放入一个JSP中

cssJs.jsp

<script type="text/javascript" src="${baseurl}/js/jquery.min.js"></script>
<script type="text/javascript" src="${baseurl}/bs/js/bootstrap.js"></script>
<link rel="stylesheet" href="${baseurl}/bs/css/bootstrap.css"/> <!--分页-->
<link rel="stylesheet" type="text/css" href="${baseurl}/controls/easyUI/themes/default/easyui.css"/>
<script src="${baseurl}/controls/easyUI/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="${baseurl}/controls/easyUI/themes/icon.css"/>
<script type="text/javascript" src="${baseurl}/controls/easyUI/jquery.easyui.min.js"></script> <!--复杂时日-->
<link rel="stylesheet" type="text/css" media="all" href="${baseurl}/controls/calendar/daterangepicker-bs3.css"/>
<script type="text/javascript" src="${baseurl}/controls/calendar/moment.js"></script>
<script type="text/javascript" src="${baseurl}/controls/calendar/daterangepicker.js"></script> <!--日历-->
<link rel="stylesheet" href="${baseurl}/controls/calendar/pikaday.css">
<script src="${baseurl}/controls/calendar/pikaday.js"></script> <script src="${baseurl}/js/menu.js"></script> <link rel="stylesheet" href="${baseurl}/css/public/indexpublic_style.css"/> <script type="text/javascript" src="${baseurl }/controls/jedate/jquery.jedate.js"></script>
<script type="text/javascript" src="${baseurl }/js/dateformat.js"></script>
<link type="text/css" rel="stylesheet" href="${baseurl }/controls/jedate/skin/jedate.css">

4.其他页面中引用

注意:先引入tag.jsp再引入   其他使用baseurl的jsp

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaUAAACUCAIAAAC84aFFAAAdo0lEQVR4nO2dz4/jxpXH+ff02SdelD+ir0FfBP4POggUAui0FwEOV+1DnxaQA9BaBNteLtYGVqZW2Thjd4yJI05gwdNqO9MYNJ3ZZLbdM/Y6W3so/nj1k8UfoqjW++Kh0WKxij9U/OjVK/LRIgq9ffs2/Xe1PustznqL4ezusr84X4kr31/2F2e9J5c3qtZQKBRq77JUBYB3qW5nT87Gd6oKt7MnZz0pDVEoFKoLMufdzXbYW1/dbIe9xVlvcdbf3oqVVuuz3mI4u296L1EoFKq+THl3f9lfDGf3V2OKs7tzwZVD/w6FQnVbZry7nT05629vyX0av0vwl61wNcb4HQqF6rhMeHezHSYsyzAH/bu7897irLe+2vm+olAoVB0V8+7uHIbksvhdOnGRun4oFArVcZWZn0WhUKhDFvIOhUIdi5B3KBTqWIS8Q6FQxyLkHQqFOhYpeGdZaGho7RmqFSHv0NA6YKhWpOUdCoXatfBaa1E1eSfcfkxWa/bBMvr0BbuOgSK/57r9MDavoW+K2jiq2MbKd3t+1crc7jiuayXmTcABBj6/JF1IzQ8a2T4hhCwccmKRiw0hATmxyEDR8sIhJza5bmyz5bUhp1Yz+yA75OLe24aQdy2qFu/Ex8vYPAI32yH4eDUugbwGeZe2OO4A7+KJ51qKhqS8SxT5jfLuwk4gcj1JKSDZH6FoQ07VcNyJmuOdeMhFvbctIe9aVHnegSx4d+fgudrzFUc0sfdk6+9DneBd5LiuU6Gd5nl3OiFE68Fl6+QKyIlFFo3tRasSD1nfe9t7UBJ516JK8o7NgwJ/IZ9crrZDmDVgtRa7y9V4fwmjusC7OLQ7wbtB6qZJoEYIoU6Qw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Vs1eiRGAWvJy4EBX3UbUtpZum3ZbYvlTi/TelD7moQZMiTeO6O4TUMm+QW9N0mlh+mQM/jp3JlOjgeEeIeFSZB8fdpEP9uwSRSZhTw36JSk4vxGG/4H69gmzgbHAQAjSdBlGE9spod/G7JqQe2uiDdxllmEuLa01oXBVuU166mm0RQlg37cLWMSjfaIVD1jeoKLqe5P6Xpoq8NPXUlDujHZMyDbJrGrNVdZknF8HjnJ9NxN5/BxjP3IRdxpVjpEneXTCdGod92duatdnAweDUj25CT1rUD2O2SJ1DvEBy3sEnLrjJVk0RSZAnL6og/R0SzIyqMCASl3N+k9SNghOIC7pIfweyYltUlFD8CA4M6+RTvWUPWdOgdluSgzWoBY+aX86uYLQb3A3PZvffaC5zQh73/XfGulfMW6M6qqZv/T0APZZDNr91ueV7DBk9bt7xT9jdztZ7e7ICVaSmn+s6AB3yITOzE2VuKGnzARJeh8Q7NDQ0tPq2byHv0NDQ2rJ9q/z7Z1EoFOowhbxDoVDHIuQdCoU6FiHvUCjUsej/AVII7+NxjJOyAAAAAElFTkSuQmCC" alt="" />

好处:只用引入上面的tag.jsp便可使用jstl与${baseurl}获取项目名字。

--------------页面中编写一个全局变量记录项目名字,在JS文件中可以用全局变量代替项目名字(便于写路径)------------------------

JSP中:

<script type="text/javascript">
var contextPath = "${pageContext.request.contextPath}";
</script>

JS中写路径的时候比如:

    $.ajax({
url : contextPath + '/findExam_findExamEmployeeByExamId.action',
data : {
"examId" : examId
},
type : 'POST',
async : true,
dataType : 'json',
success : showExamEmployeesModal,
error : function() {
alert("查询考试员工信息失败!!!")
}
});

也可以将tag.jsp上面进行改造:

    将记录项目名字的JS变量放在tag.jsp中,这样只用引入一个tag.jsp便可以在jsp中用${baseurl}表示项目根路径,在JS中用context获取项目根路径。

tag.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="baseurl" value="${pageContext.request.contextPath}"></c:set>
<script type="text/javascript">
/* 表示项目根路径,等价于 /Exam */
var contextPath = "${pageContext.request.contextPath}";
</script>

 参考:JSP中include指令和include动作浅析

  注意:静态引入相当于原封不动的将里面的内容包含进来。所以在被包含的页面不需要头和尾。