SpirngMVC报错 not declaration can be found for element ‘mvc:annotation-driven‘

错误描述:

使用mvc标签显示不能识别

<mvc:annotation-driven conversion-service="ConversionService"/>

报错:

he matching wildcard is strict,but not declaration can be found for element 'mvc:annotation-driven’

错误原因:

问题是不能识别"mvc:annotation-driven/"这个标签,肯定是xml约束文件引入的问题。修改引入的xml约束,添加约束:

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

springmvc.xml头模板

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="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">

猜你喜欢

转载自blog.csdn.net/qq_40542534/article/details/109112550