<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"
>
这是我的架构声明。但是 mvc:annotation-driven 它显示编译时错误。 匹配通配符严格,但找不到元素的声明。我无法正确找到问题所在。所以请帮忙找出这个问题。
错误: cvc-complex-type.2.4.c:匹配通配符严格,但找不到元素“mvc:annotation-driven”的声明。 你能告诉我问题出在哪里吗?
最佳答案
您的类路径中可能缺少 spring-webmvc-*.jar 文件。
关于java - <mvc :annotation-driven/> shows compile time error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11742466/