當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
Spring Boot—07应用application.properties中的配置
生活随笔
收集整理的這篇文章主要介紹了
Spring Boot—07应用application.properties中的配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
方法1
@Value("${test.msg}") private String msg;方法2
@Autowired private Environment env; String value = env.getProperty("test.msg");方法3
@RequestMapping(path="/${query.all}.json", method=RequestMethod.GET) @ResponseBody public List<User> all() {return userService.allUser(); }方法4
@Component @ConfigurationProperties(prefix = "author",locations = "classpath:author.properties") public class MyWebConfig{ private String name; private int age;轉載于:https://www.cnblogs.com/gispathfinder/p/8921103.html
總結
以上是生活随笔為你收集整理的Spring Boot—07应用application.properties中的配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 分布式缓存的25个优秀实践与线上案例 d
- 下一篇: gradle idea java ssm