如何读取配置性文件信息

来源:互联网 发布:java微信发送消息源码 编辑:程序博客网 时间:2024/04/30 05:31
        try {//            Properties pro = new Properties();//            FileInputStream in = null;//            String springConfigLocation = "/data/code/credit-ws-conf/config.properties";//            try {////                in = new FileInputStream(springConfigLocation);//                pro.load(in);////            } catch (Exception e) {//                e.printStackTrace();//            }//        String strHost = pro.getProperty("spring.mail.host");//        String strUsername = pro.getProperty("spring.mail.username");//        String strPassword = pro.getProperty("spring.mail.password"); 等于: ServiceEmail sendEmail = emailService.findSendEmailByStatus(StatusCode.EMAIL_VERIFICATION); 配置文件: # Server HTTP port.server.port=8080#dev toolsspring.devtools.livereload.enabled=true# 静态文件请求匹配方式spring.mvc.static-path-pattern=/**# 修改默认的静态寻址资源目录spring.resources.static-locations = classpath:/templates/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/logback.level.admin=INFOlogback.dir.admin=@logback.dir.admin@server.tomcat.accesslog.directory=@logging.dir.admin@server.tomcat.accesslog.prefix=access_admin_logserver.tomcat.accesslog.enabled=truesecurity.require_ssl=false#thymeleafspring.thymeleaf.cache=falsespring.mvc.favicon.enabled=falsespring.aop.auto=truespring.aop.proxy-target-class=falsespring.jackson.parser.ALLOW_UNQUOTED_FIELD_NAMES=true#spring.jackson.serialization.indent-output=true#spring.jackson.parser.ALLOW_SINGLE_QUOTES=truelogback.level.ws=INFOlogback.dir.ws=@logback.dir.ws@#jdbc.driverClassName=com.mysql.jdbc.Driver#jdbc.url=jdbc:mysql://172.24.133.35:3306/credit?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false#jdbc.username=credit_service#jdbc.password=credit_servicejdbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://127.0.0.1:3306/credit?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=falsejdbc.username=rootjdbc.password=spring.mail.host=smtp.163.comspring.mail.username=yucongyu@163.comspring.mail.password=yucong123456spring.mail.default-encoding=UTF-8spring.http.multipart.max-file-size=12800KBspring.http.multipart.max-request-size=1280KBlog.httpRestuest=true
阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 小孩胃痉挛怎么办 全身血管痉挛怎么办 四肢抽搐怎么办 晚上全身抽筋怎么办 间歇性抽搐怎么办 wps闪退怎么办 天龙八部老被杀怎么办 teredo卸载了怎么办 蝾螈不吃东西怎么办 造影片子丢失怎么办 五行缺木缺金怎么办 木土相克怎么办 蚂蟥入体怎么办 草缸泥里有虫子怎么办 头疼发烧怎么办 水蛭咬了怎么办 法令纹凹陷怎么办 观音莲变绿怎么办 特玉莲徒长怎么办 观音莲爆盆后怎么办 本命佛不戴了怎么办 打碎了观音菩萨怎么办 本命佛摔碎了怎么办 搬家观音菩萨怎么办 玫瑰金戒指划痕怎么办 翡翠磕碰了怎么办 玉摔碎了一点怎么办 绿幽灵变红了怎么办 暖风水箱漏水怎么办 汽车滴到空调水怎么办 空调漏氟怎么办 养鹰怎么办许可证 叫花鸡没有荷叶怎么办 波次毛波了怎么办 脖刺毛蜇了怎么办 被蜂蜇了怎么办 辣椒辣到手怎么办 手被海椒辣到了怎么办 海蜇明矾怎么办 海蜇头很咸怎么办 海蜇太咸怎么办