![](https://img-blog.csdnimg.cn/20190918140158853.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
问题记录
此栏目专门记录工作中遇到的问题
kass114
这个作者很懒,什么都没留下…
展开
-
Springboot静态方法读取yml配置的属性
静态方法获取yml配置的属性前言方法一、 通过@PostConstruct 注解方法二、使用@ConfigurationProperties1.引入依赖总结前言有时候我们需要在static方法中获取propertie配置文件中的自定义的参数信息,通过@value注解是不能直接使用的,有两种方法解决此问题方法一、 通过@PostConstruct 注解代码如下(示例):@Componentpublic class ConfigKeyUtil { private final Envir原创 2021-08-24 16:44:18 · 3486 阅读 · 0 评论 -
SpringBoot程序启动出现 No visible constructors in class
Spring动态代理引发的问题问题:Spring在使用私有化构造器注入,程序无法启动public class ItemsController { private final UserHelper userHelper; private final ItemsService itemsService; //私有化构造器 @Autowired private ItemsController(ItemsService itemsService, UserHelper u原创 2021-08-17 15:37:23 · 2960 阅读 · 0 评论