我想访问应用程序中提供的值。属性,例如:
logging.level.org.springframework.web:调试
logging.level.org.hibernate:错误
logging.file=${HOME}/application.log
userBucket.path=${HOME}/bucket
我想在Spring引导应用程序的主程序中访问userBucket.path
您可以使用@Value注释并访问正在使用的Springbean中的属性
@Value(“${userBucket.path}”)
私有字符串userBucketPath;