Scope_Pre_Post
@Scope , 设置bean的生命周期,示例:
@Scope(value="prototype")//设置生存范围,一般用 singleton或prototype
14.@PostConstruct = init-method;@PreDestroy = destroy-method
示例:
@PostConstruct//构造完成之后执行,跟xml配置的init-method作用相同
public void init(){
System.out.println("init");
}
@PreDestroy//容器销毁对象之前执行,作用和xml配置的destroy-method一样
public void destroy(){
System.out.println("destroy");
}
代码链接: http://pan.baidu.com/s/1nvLoyRv 密码: f7sx
jar包链接: http://pan.baidu.com/s/1hs655SK 密码: 6h8x
Scope_Pre_Post的更多相关文章
随机推荐
- abp + angular 前端使用 hash ,登录界面不跳转问题
abp 项目默认的路由没有使用hash,这会导致手动刷新浏览器时,页面404错误: 解决方法网上很多,就是在路由里添加一个{useHash: true},就行了. #用Hash带来的新问题# abp框 ...
- 关于 Gojs 你可能用到的方法 / gojs自定义 / gojs
以下归纳如果对你有帮助的话请点下文章下面的推荐,谢谢! 1.阻止键盘事件 myDiagram.commandHandler.doKeyDown = function () { var e = myDi ...
- Ibatis批量处理
1.插入 <insert id="insTable" resultClass="int"> INSERT INTO [dbo].[table] ([ ...
- C. Nice Garland-------字符串
C. Nice Garland time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- C语言实现排序
//C语言版排序#include<stdio.h> #include<stdlib.h> //冒泡排序 void bubleSort(int data[], int n); / ...
- 破解myBase试用到期
请保持你的myBase7是关闭的 1.找到myBase7的安装目录(myBase.exe的目录): 2.右键编辑打开myBase.ini: 3.找到 App.UserLic.FirstUseOn,并在 ...
- css 小知识点
苹果浏览默认表单 单选 多选 下拉列表 效果的去除 提交按钮-webkit-appearance: none;-moz-appearance: none;-ms-appearance: none;ap ...
- java与C语言在字符串结束符上的区别
综述:在C语言中字符串或字符数组最后都会有一个额外的字符‘\0’来表示结束,而在java语言中没有结束符这一概念.具体见下面分析. 1. C 语言 在C语言中字符串和字符数组基本上没有区别,都需要结束 ...
- 怎么理解impala(impala工作原理是什么)
下面给大家介绍怎么理解impala,impala工作原理是什么. Impala是hadoop上交互式MPP SQL引擎, 也是目前性能最好的开源SQL-on-hadoop方案. 如下图所示, impa ...
- this 显示绑定
function foo (el) { console.log(el, this.id); } var obj = { id: 'aaa' }; [2,6,3].forEach(foo, obj); ...