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

Ste*_*eve 4 spring spring-mvc

根据http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources的建议,我希望用它<mvc:resources>来提供我的弹簧静态内容.

我尝试了以下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>
Run Code Online (Sandbox Code Playgroud)

axt*_*avt 10

属性在<mvc:resources>Spring 3.0.4中添加.

编辑即:您只需将Spring 3.0.4添加到您的依赖项中,一切正常(Eclipse插件中的错误标记除外).在运行时,配置文件由Spring本身解析,因此使用Spring的内置XSD文件.