SpringBoot:第三篇 配置修改

1.启动端口修改 application.properties

server.port=8080

2.不同环境配置文件支持 application.properties

spring.profiles.active=prod

3.使用xml配置----启动类添加配置

@ImportResource("classpath:spring-config-*.xml"

4.使用其他配置文件---启动类添加配置

@PropertySource(value = {"classpath:conf.properties"}, encoding = "utf-8")
----使用----
@Value("${user.name}")
private String userName;

 

posted @ 2019-06-14 16:08  诸葛子房  阅读(356)  评论(0编辑  收藏  举报