1 引入context命名空间(在Spring的配置文件中),配置文件如下:
- xmlns:context="http://www.springframework.org/schema/context"
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd
xmlns:context="http://www.springframework.org/schema/context" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
打开配置
spring 会自动扫描cn.pic包下面有注解的类,完成Bean的装配。