Chinaunix首页 | 论坛 | 博客
  • 博客访问: 289737
  • 博文数量: 23
  • 博客积分: 409
  • 博客等级: 一等列兵
  • 技术积分: 272
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-19 13:38
文章分类

全部博文(23)

文章存档

2013年(1)

2012年(22)

我的朋友

分类: Java

2013-05-09 18:00:01

经常是一个项目要在多个环境下部署,有些参数需要经常改变,如数据源连接参数。如果把参数配置在服务器上如tomcat上,就不需要经常修改了。

 

  path=""   reloadable="false" >

        

        

                      

 

 

applicationContext.xml获取方式如下:

         destroy-method="close">

        

        

        

        

        

        

        

        

        

        

 

 

原因如下:

Context Parameters

 

    You can configure named values that will be made visible to the web application as servlet context initialization parameters by nesting elements inside this element. For example, you can create an initialization parameter like this:

                      

            

 

   

      ...

     

             override="false"/>

      ...

   

 

    This is equivalent to the inclusion of the following element in the web application deployment descriptor (/WEB-INF/web.xml):

                      

  

      companyName

      My Company, Incorporated

   

 

    but does not require modification of the deployment descriptor to customize this value.

 

 

 

Spring Expression Language (SpEL)可参考链接如下:

阅读(2371) | 评论(0) | 转发(0) |
0

上一篇:程序升级改造原则

下一篇:没有了

给主人留下些什么吧!~~