在做SpringMVC项目时报:通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明

解决方法:

在文件头上加上下面这句就OK了

xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd"

版权声明:本文为wan_rong原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。