美文网首页
IoC:加载Properties文件

IoC:加载Properties文件

作者: 木山手札 | 来源:发表于2019-10-26 15:11 被阅读0次

Properties加载方式

  • @PropertySource("classpath:/person.properties")
  • 直接赋值,@Value("张三")/
  • SpringEL,@Value("#{10+10}")
  • 占位符,@Value("${person.address}"),实现EmbeddedValueResolverAware接口,stringValueResolver.resolveStringValue("${person.address}")

相关文章

网友评论

      本文标题:IoC:加载Properties文件

      本文链接:https://www.haomeiwen.com/subject/tsccmctx.html