spring管理下系统加载类

来源:互联网 发布:windows udp端口监听 编辑:程序博客网 时间:2024/04/29 19:04

 系统加载时执行的类,也是我们将需要加载的参数配置的地方 。必须实现 ServletContextListener

 

 

说明 :

SystemParamBean  放置我需要加载的系统参数

sysParamService  是我在 applicationContext.xml 中配置的从数据库中得到参数值的bean

 

当然不要忘记在 web.xml 中添加

 

  

 

在Action 中得到系统参数:

  

 

 

参考文章 :

 

http://hi.baidu.com/29163077/blog/item/b3b77bdd5c1a94ea76c638f7.html

 

http://lichengyezi.javaeye.com/blog/508128