【发布时间】:2012-01-31 19:52:54
【问题描述】:
我无法克服这个错误。 mvc xsd 是正确的并且验证了资源元素存在。为什么这个 spring 配置文件不能解析 mvc:resources 元素
SAXParseException: cvc-complex-type.2.4.c: 匹配通配符是严格的,但找不到元素“mvc:resources”的声明
我使用的是springframework v3.0.2
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan annotation-config="true" base-package="com.auto"/>
<mvc:annotation-driven />
<mvc:view-controller path="/" view-name="index"/>
<mvc:resources location="/resources/" mapping="/resources/**"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
【问题讨论】:
标签: spring spring-mvc