@PostConstruct和@PreDestroy
来源:互联网 发布:php nginx 403 编辑:程序博客网 时间:2024/05/21 17:53
1、@PostConstruct
被@PostConstruct修饰的方法会在服务器加载Servlet的时候运行,并且只会被服务器调用一次,类似于init()方法。
被@PostConstruct方法修饰的方法会在构造函数之后,init()方法之前执行。
2、@PreDestory
被@PreDestory修饰的方法会在卸载Servlet的时候运行,并且只会被服务器调用一次,类似destory()方法。
服务器在启动的时候回检查webapp/classes下的和jar包所有class文件,检查哪些类使用了注解,如果没有使用注解可以
使用metadata-complete=true来屏蔽注解检查。
支持@PostConstruct和@PreDestory注解的服务器需要支持到Servlet2.5及以上规范,所以使用时
应使用tomcat6.x及以上版本。
0 0
- @PostConstruct 和 @PreDestroy 使用
- @PostConstruct 和 @PreDestroy
- @PostConstruct 和 @PreDestroy
- @PostConstruct 和 @PreDestroy
- @PostConstruct和@PreDestroy
- @PostConstruct 和 @PreDestroy
- @PostConstruct 和 @PreDestroy 使用
- Spring @PostConstruct 和 @PreDestroy
- Spring Annotation(注解) @Scope ,@PostConstruct 和@PreDestroy
- Spring注解之 @PostConstruct和 @PreDestroy
- Servlet注解之@PostConstruct和@PreDestroy
- @Scope、@PostConstruct、@PreDestroy
- 注解@PostConstruct与@PreDestroy
- 注解@PostConstruct与@PreDestroy
- 注解@PostConstruct与@PreDestroy
- @PostConstruct and @PreDestroy example
- 注解@PostConstruct与@PreDestroy
- 注解@PostConstruct与@PreDestroy
- 【FFMPEG】FFMPEG程序捕获Mac设备流媒体
- mysql导出数据表结构,必须退出mysql命令.重新使用msyqldump命令
- mac 上找不到 lippicv, 坑
- Swift的一些基本属性1 (常量变量)
- css实现h5页面滚动效果
- @PostConstruct和@PreDestroy
- 解决Please choose a writable location using the '-configuration' command line option"
- jdkd环境变量
- Android 内存泄漏调试
- android之adb命令操作
- 作为 .Net 攻城师,所必需掌握的 .Net Profiling 技术
- 详解:scrollview嵌套listview,而listview的item中是webview,导致listview不能在scrollview完全伸展开的问题
- Codeforces--630F--Selection of Personnel(组合数)
- struts2多文件上传(修改名称、压缩图片、删除图片)