Spring使用mvc:resources提供静态内容,无效的xsd

问题描述

<mvc:resources>在Spring 中添加了中的属性

就是:您只需将Spring 3.0.4添加到您的依赖项中,一切就可以正常工作(Eclipse插件中的错误标记除外)。在运行时,Spring本身会解析配置文件,因此将使用Spring的内置XSD文件

解决方法

http://static.springsource.org/spring/docs/3.0.x/spring-framework-
reference/html/mvc.html#mvc-static-
resources所建议,我希望<mvc:resources>用于提供spring静态内容。

我尝试了以下XML,但是.xsd文件不包含的声明,<mvc:resources>因此找不到替代的.xsd。我可以忽略eclipse错误,但是由于SAXParseException,服务器无法启动。

我哪里出问题了?

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <mvc:resources mapping="/css/**" location="/css/"/>

</beans>