@ConfigurationProperties vs. @Value

@ConfigurationProperties vs. @Value

@ConfigurationProperties vs. @Value

If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated with @ConfigurationProperties. Doing so will provide you with structured, type-safe object that you can inject into your own beans.

SpEL expressions from application property files are not processed at time of parsing these files and populating the environment. However, it is possible to write a SpEL expression in @Value. If the value of a property from an application property file is a SpEL expression, it will be evaluated when consumed via @Value.

@ConfigurationProperties vs. @Value

上一篇:vue滑动内容实现横向滑动滚动条效果


下一篇:idea中自定义修改jdk源码,加注释