zgzf

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;

 

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2021-06-29
  • 2021-12-15
  • 2021-11-20
  • 2021-11-20
  • 2021-06-10
猜你喜欢
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-10-03
  • 2021-10-29
  • 2022-12-23
相关资源
相似解决方案