spring 2.5 中配置bean 使用annotation
2009-05-02 18:13
501 查看
IBM文档:http://www.ibm.com/developerworks/cn/java/j-lo-spring25-ioc/
@Autowired (自动装配,bytype)
@Resource (name = , type = ) byName
@Componet("name") 注册
@PostConstruct
@PreDestory
(可有多个方法,而不是init-method init-destory只有一个)
需要引入 commons- annotations .jar
在配置文件中声明 一些config处理annotation
@Autowired (自动装配,bytype)
@Resource (name = , type = ) byName
@Componet("name") 注册
@PostConstruct
@PreDestory
(可有多个方法,而不是init-method init-destory只有一个)
需要引入 commons- annotations .jar
在配置文件中声明 一些config处理annotation
相关文章推荐
- 扩展Spring——使用 Annotation将配置资源注入到Bean中
- 扩展Spring——使用 Annotation将配置资源注入到Bean中
- spring3 混合使用 XML 与注解(Annotation)进行 Bean 的配置
- 使用Spring 2.5注解自动注册Bean的配置
- 配置整合DWR3.0和Spring2.5使用annotation注解
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- spring3 混合使用 XML 与注解(Annotation)进行 Bean 的配置
- Spring学习笔记 使用annotation配置实现Bean的auto-wiring (自动绑定)
- 注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- [注解的力量]Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置
- 【Spring】使用FactoryBean配置Bean
- Spring使用xml配置bean,主要是constructor-arg
- hibernate4不使用hibernate3的AnnotationSessionFactoryBean配置sessionFactory
- spring学习5-注解式bean配置+Junit简易使用
- Spring3.2 中 Bean 定义之基于 Annotation 和 Java Code 配置方式的源码解析
- spring2.5 及 hibernate annotation 配置文件笔记
- 在普通Java类里使用spring配置文件里的bean类如dao,service
- Spring使用@Autowired,@Qualifier,@Resource注解配置bean