Spring 自动扫描 注解驱动 Bean 管理
来源:百度文库 编辑:神马文学网 时间:2024/04/28 18:13:45
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
过滤器类型说明
注释假如 com.baobaotao.SomeAnnotation 是一个注释类,我们可以将使用该注释的类过滤出来。
类名指定通过全限定类名进行过滤,如您可以指定将 com.baobaotao.Boss 纳入扫描,而将 com.baobaotao.Car 排除在外。
正则表达式通过正则表达式定义过滤的类,如下所示: com\.baobaotao\.Default.*
AspectJ 表达式通过 AspectJ 表达式定义过滤的类,如下所示: com. baobaotao..*Service+
下面是一个简单的例子:
值得注意的是
默认情况下通过 @Component 定义的 Bean 都是 singleton 的,如果需要使用其它作用范围的 Bean,可以通过 @Scope 注释来达到目标,如以下代码所示:
Spring 自动扫描 注解驱动 Bean 管理
Spring 自动扫描 注解驱动 Bean 管理
Spring内核研究-管理bean之间的关系二(自动依赖检查)
Spring + Struts2 注解驱动配置文件【web.xml】
Spring 注解
struts2注解驱动 零配置
Spring Web MVC 的HandlerMapping的使用之-------Bean...
JSF中Backing Bean的管理
JSF中Backing Bean的管理 - Java
管理IT 驱动业务
快速上手Spring--11. 自动绑定和依赖检查
快速上手Spring--11. 自动绑定和依赖检查
用Win7独有功能 禁USB自动安装驱动
工作分析,驱动人力资源管理变革
Spring
Spring
spring
Spring
Spring
Spring
流程管理:角色驱动的流程变化管理
管理,职场,电子书,《自动自发》pdf
Struts2中使用注解 管理Action方法的权限
the nutrition of bean