SpringBoot中通过@Value获取自定义配置的值

场景 在SpringBoot项目中的application.properties中定义变量,要在 controller中获取自定义配置的值。 实现 打开 application.properties 添加如下代码 book.author=Badao book.name=SpringBoot 新建BookController.java package com.example.demo.control
相关文章
相关标签/搜索