在java web项目中我们通常会有这样的需求:当项目启动时执行一些初始化操作,例如从数据库加载全局配置文件等,通常情况下我们会用javaee规范中的Listener去实现

常用的监听器有spring的ContextLoaderListener  或者logback

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-application.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>ch.qos.logback.ext.spring.web.LogbackConfigListener</listener-class>
</listener>
<context-param>
<param-name>logbackConfigLocation</param-name>
<param-value>classpath:logback.xml</param-value>
</context-param>

最新文章

  1. Office文档在线预览
  2. BZOJ1527 : [POI2005]Pun-point
  3. ASP.NET之Cookie(坑爹的Response.Cookies.Remove)(转)
  4. net2.0对于递归变量的处理方式不同引发的递归问题
  5. Given a compiled machine-language program, which statements in the source language cause the execution of the most machine-language instructions and what is the execution time of these instr
  6. python 操作消息队列
  7. 各种主流数据库的比较(所以说我觉得Oracle这个keng?入的不错?)
  8. Bzoj 1648: [Usaco2006 Dec]Cow Picnic 奶牛野餐 深搜,bitset
  9. python 学习笔记整理
  10. JAVA字符串比较equals()和equalsIgnoreCase()差异
  11. volatile作用及相关集合类
  12. ORA-02030: can only select from fixed tables/views
  13. request.getParameterNames()和request.getParameterValues()
  14. BZOJ2119 股市的预测 字符串 SA ST表
  15. HDFS API编程
  16. 【PyTorch深度学习60分钟快速入门 】Part0:系列介绍
  17. linux开启远程访问端口
  18. Calculate CRC32 as in STM32 hardware (EWARM v.5.50 and later)
  19. Linux文本编辑器(九)
  20. JDBC-批处理操作

热门文章

  1. 【POJ3352】Road Construction(边双联通分量)
  2. Linux 之 MySQL主从同步
  3. 正确使用‘trap指令’实现Docker优雅退出
  4. Codeforces 404E: Maze 1D(二分)
  5. docker部署 mysql redis问题
  6. 洛谷——P2386 放苹果
  7. [CQOI2018] 社交网络
  8. bzoj 4921: [Lydsy六月月赛]互质序列
  9. screen状态变Attached连接会话失败
  10. spring事务详细理解