配置如下
<mvc:annotation-driven/>
<mvc:resources mapping="/css/**" location="/static/css/" />
<mvc:resources mapping="/images/**" location="/static/images/" />
<mvc:resources mapping="/view/**" location="/static/view/" />
<mvc:resources mapping="/fonts/**" location="/static/fonts/"/>
<mvc:default-servlet-handler/>
目录结构:
错误信息:
问题最后我自己解决了..
解决方法:
先将ContextPath放如page中,再使用el表达式取出,问题得以解决。
<%String path = request.getContextPath(); %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=path %>/static/css/login2.css" rel="stylesheet" type="text/css"/>
http://blog.csdn.net/wangqingqi20005/article/details/48134649
将static
去掉