zoukankan      html  css  js  c++  java
  • 配置文件,环境配置和war报分离,方便生产更改

    在生产环境实现配置文件和war包 的分离,为方便在必要的时候进行一定的更改,可以避免修改包,但是需要重启

    最初为这样的选择配置,单不知为何未生效,修改为配置2配置方法,但不灵活,待跟进。
    配置1:

    <context:property-placeholder
    ignore-resource-not-found="true"
    location="file:${CONF_PATH}/${sysconfig.properties.file},classpath*:/${sysconfig.properties.file}" />

    配置2:
    <!-- 环境配置和war包分离 以外部配置为准-->

    <context:property-placeholder 
    order="1" 
    ignore-resource-not-found="true"
    ignore-unresolvable="true" 
    location="file:${CONF_PATH}/${sysconfig.properties.file}" />
    
    <context:property-placeholder 
    order="2" 
    ignore-resource-not-found="true" 
    ignore-unresolvable="false"
    location="classpath*:/${sysconfig.properties.file}" />

    注:order 值越小,优先级越高

  • 相关阅读:
    js中使用EL表达式
    洛谷——RMQ
    模板——RMQ
    洛谷——图论
    洛谷——基础搜索
    洛谷——搜索
    搭桥
    简单dp
    Codevs 3194 基因变异
    cin、scanf、gets、getchar 用法介绍
  • 原文地址:https://www.cnblogs.com/lianshan/p/5660833.html
Copyright © 2011-2022 走看看