spring boot的properties配置

一、application.properties的设置

1,server.context-path=/ww

加了这个属性后,访问地址变化:

http://localhost:8089/index

http://localhost:8089/ww/index

在properties也可以自定义一些属性(随便写)

2,spring.profiles.active=dev

指定不同的配置文件

3,

扫描二维码关注公众号,回复: 3472571 查看本文章

@Configuration  作用在类上,相当于xml文件的配置

@Bean   作用在方法上,相当于xml中配置的<bean>

三、

猜你喜欢

转载自blog.csdn.net/qq_22059611/article/details/82898418
今日推荐