springboot學習第三天之異步調用、自定義參數、修改端口號、yml使用

1.springboot中默認實現異步 單線程,結果1342  多線程異步,使用 @Async註解,結果1234,在主程序運行類上添加 @EnableAsync註解,開啓異步 2.自定義參數 配置文件值:在applications.properties中添加 name= www.baidu.com 配置文件值; @Value("$(name)")//通過value註解獲得值 private Str
相關文章
相關標籤/搜索