网站首页
编程语言
数据库
系统相关
其他分享
编程问答
ConfigUtils
2024-09-27
01.SpringBoot开发杂记-使用工具类,静态读取配置文件中的配置的写法
使用工具类,静态读取配置文件中的配置的写法@ComponentpublicclassConfigUtils{privatestaticConfigUtilsinstance;//单例模式持有当前工具类的实例privateConfigUtils(){}@Value("${system.uploadPath}")privateStringuploadPath;//@Value注解