开始时引用easyUI时一直无法引用成功报404错误,解决办法如下:
web.xml中添加下列代码(SpringMVC之前):
<servlet-mapping>
<servlet-name >default </servlet-name >
<url-pattern >*.js</url-pattern>
</servlet-mapping >
<servlet-mapping >
<servlet-name >default </servlet-name >
<url-pattern >*.css</url-pattern>
</servlet-mapping>
jsp页面:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
<script type="text/javascript" src="<%=basePath%>static/easyui-1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>static/easyui-1.4.1/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>static/easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/easyui-1.4.1/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>static/easyui-1.4.1/themes/default/easyui.css">
这样就可以了