1. 程式人生 > >萬用字元的匹配很全面, 但無法找到元素 'context:component-scan' 的宣告。

萬用字元的匹配很全面, 但無法找到元素 'context:component-scan' 的宣告。

檔案頭補上

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"

即可

<context:component-scan base-package="org.itee.se.impl"/>

寫完之後也一定要記得補上<aop:aspectj-autoproxy/>