SpringBoot 如何用值注解list

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
@Value("#{'${server.name}'.split(',')}")
private List<String> servers;
@Value("#{'${server.name}'.split(',')}") private List<String> servers;
@Value("#{'${server.name}'.split(',')}")
private List<String> servers;

上述也可直接用于Set

Leave a Reply

Your email address will not be published. Required fields are marked *