2021
02-21
02-21
详解SpringBoot注解读取配置文件的方式
一、@Value读取application.properties配置文件中的值application.properties配置文件fileName=configNamePropertiesConfig类文件importorg.springframework.beans.factory.annotation.Value;importorg.springframework.stereotype.Component;@ComponentpublicclassPropertiesConfig{//通过@Value注解读取fileName的值@Value("${fileName}")privateStringfileName;publicStringgetFileName(){returnfileNam...
继续阅读 >