您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

cvc-complex-type.2.4.c:匹配的通配符很严格,但是找不到元素'mvc:annotation-driven'错误的声明

cvc-complex-type.2.4.c:匹配的通配符很严格,但是找不到元素'mvc:annotation-driven'错误的声明

你有这个:

xmlns:mvc="http://www.springframework.org/schema/mvc"

但您在这里没有提及它:

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/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

还有,就像

xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
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">

注意:模式引用实际上没有提到Spring版本,以方便升级,这是很常见的做法,因此,您应该使用like之类的引用,http://www.springframework.org/schema/context/spring- context.xsd而不要使用名称中包含的引用-3.0

其他 2022/1/1 18:20:56 有589人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶