如下方式使用Spring EL

 @Value("#{'${my.list.of.strings}'.split(',')}") 
 private List<String> myList;

然后在.properties中这样配置

my.list.of.strings=A , B , C , D

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
猜你喜欢
  • 2021-10-24
  • 2022-02-08
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案