五、Spring中注解的使用

1. Bean的作用域也可利用注解的方式进行限定: 如:@Scope(“prototype”),将其写定义类的前面 其功能类似于标签中的<bean id=”” class=”” scope=” prototype”/> 2. 通过注解还可为bean提供初始化方法以及销毁方法: 在方法前加上:@PostConstruct,则在实例化类时将执行该方法,类似于标签中的<bean init-method=
相关文章
相关标签/搜索