我知道很多问题都问过这个问题。我正在发帖,因为我尝试了所有选项,但仍然收到错误。
<?xml version="1.0" encoding="UTF-8"?>
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd ">
<mvc:annotation-driven></mvc:annotation-driven>
<context:component-scan base-package="com.cts"></context:component-scan>
<mvc:bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp" />
<property name="suffix" value=".jsp" />
</mvc:bean>
<mvc:bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
</mvc:bean>
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"></bean>
<mvc:interceptors>
<bean class="org.springframework.web.,servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="locale"></property>
</bean>
</mvc:interceptors>
我明白了
描述资源路径位置类型 cvc-complex-type.2.4.c:匹配通配符严格,但找不到元素“mvc:bean”的声明。 spring-servlet.xml/CATestSlotBooking_Skeleton/WebContent/WEB-INF 第 17 行 XML 问题
我正在使用 Spring 4.01 发布 jar
最佳答案
看起来架构丢失。
更新 XML header ,如下所示。
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
关于java - 但找不到元素 'mvc:bean' 的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47594639/