zoukankan      html  css  js  c++  java
  • properties配置应用,为什么需要使用properties文件

    在项目中我们常常会使用Constants常量类,达到系统全局配置的目的。

    但是有些常量需要动态的配置,如果项目上线后,每次修改Constants.java然后再编译,再上传Constants.class文件,再重启服务器。这样导致很繁琐。

    如果将需要修改的配置项写成properties文件,将会在项目后期维护带来很大的方便~!

    root.url=http://localhost:8080/BNCAR2/
    root.path=E:/ws2/BNCAR2/rel/
     
    mall.partstype.url=mall.jsp?rowid=0&typeFlag=0&pid=35
    mall.carproduct.url=mall.jsp?rowid=0&typeFlag=1&pid=74
    
    mall.partstype.typename1=u4FDDu517Bu5957u88C5
    mall.partstype.typename2=u7CFBu7EDFu517Bu62A4
    mall.partstype.typename3=u8F6Eu80CEu8F6Eu6BC2
    
    network.province.name1=u4E0Au6D77
    network.province.name2=u6C5Fu82CF
    
    pageutil.persize=10

    注意名=值之间不要留空格,注意名的命名习惯,一般为小写,层级关系之间用点号分隔。

  • 相关阅读:
    PRCT-1302 the OCR has an invalid ip address
    函数listen
    函数bind
    函数socket
    lamp。查看版本
    yii 日期插件
    UCenter 的目录结构
    API接口
    返回标签数据示例 (PHP)
    应用接口函数
  • 原文地址:https://www.cnblogs.com/simpledev/p/3525981.html
Copyright © 2011-2022 走看看