<pre name="code" class="html"><?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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<!--
以下配置是采用XML方法手工配置
<bean id="test" class="com.sss.test1.Test"></bean>
-->
<!-- 这部分是注释内容,配置自动扫描的包,采用注解零配置的方法 -->
<context:component-scan base-package="com.sss" >
<!-- 可以配置<context:include-filter type="regex" expression=".service.*"/> 进行过滤部分类 -->
</context:component-scan>
</beans>
spring 自动扫描 注入
最新推荐文章于 2023-02-24 00:00:23 发布