原因:../不能正确返回
解决办法:jsp文件加<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
样式表地址采用<%=path %>/替换../
例:<link href="../css/main.css" rel="stylesheet" type="text/css" media="all" />
替换为<link href="<%=path %>/css/main.css" rel="stylesheet" type="text/css" media="all" />
网上大多数说是因为没配置静态文件。如以上方法不行,请尝试配置如下格式的静态文件:
<mvc:resources mapping="/images/**" location="/images/"></mvc:resources>