在springMVC中配置<mvc>标签,运行时报错 无法找到MVC元素

来源:互联网 发布:软件销售许可证办理 编辑:程序博客网 时间:2024/06/05 03:13

在SpringMVC的XML文件中配置如

<mvc:default-servlet-handler/>

运行时,会报错

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler/

此时需要注意,SpringMVC中的xml文件xsi中是否包含这两个元素

xsi:schemaLocation="http://www.springframework.org/schema/mvc                     http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"

加上这两个location后,即可执行成功。

0 0
原创粉丝点击