springMVC:通配符的匹配很全面, 但無法找到元素 'mvc:annotation-driven' 的聲明


轉自:http://blog.csdn.net/tolcf/article/details/50845483

報錯信息:通配符的匹配很全面, 但無法找到元素 'mvc:annotation-driven' 的聲明

原因是:雖然在xml文件上方聲明了mvc,但沒有配置此聲明對應的文件信息,正確配置如下:

<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  ">

 

意思就是,mvc聲明用http://www.springframework.org/schema/mvc/spring-mvc.xsd這個文件來解析


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM