1 再jsp中引入.inc文件:
<%@ include file="/static/common/js.inc" %>
2 再js.inc中引入常用的插件:
<?xml version="1.0" encoding="UTF-8" ?>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link href="${ctx}/static/css/default/common.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<c:choose>
<c:when test="${query14}">
<script src="${ctx}/static/js/jquery/jquery-1.4.4.min.js?ver=<tags:version/>" type="text/javascript"></script>
</c:when>
<c:when test="${query214}">
<script src="${ctx}/static/js/jquery/jQuery-2.1.4.min.js?ver=<tags:version/>" type="text/javascript"></script>
</c:when>
<c:otherwise>
<script src="${ctx}/static/js/jquery/jquery-1.7.1.min.js?ver=<tags:version/>" type="text/javascript"></script>
</c:otherwise>
</c:choose>
<script type="text/javascript" src="${ctx}/static/js/ui/jquery.ui.widget.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/common/ips.public.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/common/const.js?ver=<tags:version/>" type="text/javascript"></script>
<c:if test="${ymPrompt}">
<!-- 消息提示插件 -->
<link href="${ctx}/static/js/ymPrompt/skin/ips/ymPrompt.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<script src="${ctx}/static/js/ymPrompt/ymPrompt.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${queryGrid}">
<!-- 查询类表样式 -->
<link href="${ctx}/static/css/query_grid.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
</c:if>
<c:if test="${grid}">
<!--grid列表-->
<link type="text/css" rel="stylesheet" href="${ctx}/static/js/flexigrid/flexigrid.css?ver=<tags:version/>" />
<script type="text/javascript" src="${ctx}/static/js/flexigrid/jquery.flexigrid.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.grid.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${dateFormat}">
<!-- 时间格式化 -->
<script src="${ctx}/static/js/common/date.format.js?ver=<tags:version/>" type="text/javascript"></script>
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.date.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${validate}">
<!-- jquery验证 -->
<script src="${ctx}/static/js/validate/jquery.validate.min.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/validate/jquery.validate.ext.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/validate/messages_cn.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${wdatePicker}">
<!-- 时间控件 -->
<script type="text/javascript" src="${ctx}/static/js/My97DatePicker/WdatePicker.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${splitter}">
<!-- splitter -->
<link href="${ctx}/static/css/splitter.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<script src="${ctx}/static/js/splitter/splitter.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/splitter/my_splitter.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${baidumapapi}">
<!-- 百度api -->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=3232e425626930bc7d646fbbb0d1d3ac"></script>
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.bmap.js?ver=<tags:version/>"></script>
<link href="${ctx}/static/css/map_g_set.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<link href="${ctx}/static/css/map_g.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.tools.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.distancetool.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.showsetting.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.functions.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.marker.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.truck.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.truck.track.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.truck.monitor.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.polygon.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.line.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.alarm.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.search.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/markerclusterer/bmap/sina_markerclusterer.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.popup.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/popupmarker_bmap.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/common/gpsinfo.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${baidubiaozu}">
<!-- 百度标注 -->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=3232e425626930bc7d646fbbb0d1d3ac"></script>
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.bmap.js?ver=<tags:version/>"></script>
<link href="${ctx}/static/css/map_g_set.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.ezmaker.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${baidumaphuiorder}">
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.searchinrectangle.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/bmap/imap.xorder.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${acbox}">
<link href="${ctx}/static/js/acbox/css/jquery.ajaxComboBox.css?ver=<tags:version/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.acbox.js?ver=<tags:version/>"></script>
<script type="text/javascript" src="${ctx}/static/js/acbox/js/jquery.ajaxComboBox.3.5.7.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${multiselecthui}">
<script type="text/javascript" src="${ctx}/static/js/hui/jquery.hui.multiselet.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${multiselect}">
<link href="${ctx}/static/js/jmultiselectAtoB/css/jquery.multiselect2side.css?ver=<tags:version/>" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${ctx}/static/js/jmultiselectAtoB/js/jquery.multiselect2side.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${autocomplete}">
<link href="${ctx}/static/js/jq.autocomplete/autostyles.css?ver=<tags:version/>" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="${ctx}/static/js/jq.autocomplete/jquery.autocomplete.js?ver=<tags:version/>"></script>
</c:if>
<c:if test="${tree}">
<!-- 资源树js -->
<link rel="stylesheet" href="${ctx}/static/js/zTree/css/zTreeStyle/zTreeStyle.css?ver=<tags:version/>" type="text/css">
<script src="${ctx}/static/js/zTree/js/jquery.ztree.core-3.0.min.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/zTree/js/jquery.ztree.excheck-3.0.min.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/zTree/js/jquery.ztree.exedit-3.0.min.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/hui/jquery.hui.tree.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${showLoading}">
<script type="text/javascript" src="${ctx}/static/js/showLoading/jquery.showLoading.js?ver=<tags:version/>"></script>
<link rel="stylesheet" href="${ctx}/static/js/showLoading/css/showLoading.css?ver=<tags:version/>" type="text/css">
</c:if>
<c:if test="${sprintf}">
<script src="${ctx}/static/js/common/jquery.sprintf.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${tablednd}">
<script src="${ctx}/static/js/jq.tablednd/jquery.tablednd_0_5.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${easydrag}">
<script src="${ctx}/static/js/jq.easydrag/jquery.easydrag.handler.beta2.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${webuploader}">
<link href="${ctx}/static/js/webuploader-0.1.5/webuploader.css?ver=<tags:version/>" type="text/css" rel="stylesheet"/>
<script src="${ctx}/static/js/webuploader-0.1.5/webuploader.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/webuploader-0.1.5/uploader-single.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/webuploader-0.1.5/uploader-multitype.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${ueditor}">
<link href="${ctx}/static/js/ueditor/video/video-js.css?ver=<tags:version/>" rel="stylesheet">
<script src="${ctx}/static/js/ueditor/video/video.min.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/ueditor/video/videojs-contrib-hls.js?ver=<tags:version/>"></script>
<script src="${ctx}/static/js/ueditor/ueditor.config.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/ueditor/ueditor.all.js?ver=<tags:version/>" type="text/javascript"></script>
<script src="${ctx}/static/js/ueditor/lang/zh-cn/zh-cn.js?ver=<tags:version/>" type="text/javascript" charset="utf-8" ></script>
</c:if>
<c:if test="${eara}">
<script src="${ctx}/static/js/eara/script.js?ver=<tags:version/>" type="text/javascript"></script>
</c:if>
<c:if test="${spectrum}">
<script src="${ctx}/static/js/spectrum/spectrum.js?ver=<tags:version/>" type="text/javascript"></script>
<link href="${ctx}/static/js/spectrum/spectrum.css?ver=<tags:version/>" type="text/css" rel="stylesheet"/>
</c:if>
3 再jsp页面的首页引入相关插件:
<!-- 消息提示插件 -->
<c:set var="ymPrompt" value="true" />
<!-- 查询类表样式 -->
<c:set var="queryGrid" value="true" />
<!--表单验证-->
<c:set var="validate" value="true" />
<c:set var="acbox" value="true" />
<c:set var="webuploader" value="true" />
这样就可以再页面中使用相关插件了