Skip to content

Instantly share code, notes, and snippets.

@alex-bezverkhniy
Last active September 10, 2019 17:40
Show Gist options
  • Save alex-bezverkhniy/7eb6d01b3618d99fd7d58b8ff5c7d2dc to your computer and use it in GitHub Desktop.
Save alex-bezverkhniy/7eb6d01b3618d99fd7d58b8ff5c7d2dc to your computer and use it in GitHub Desktop.
Spring Boot - cheatsheet

Set array value via expression-driven dependency injection - @Value

import org.springframework.beans.factory.annotation.Value;
...
    @Value("${client.contextPaths:com.myapp.defaultmodel}")
    protected String[] contextPaths;

Comma separated values in .yml file application.yml

client:
  contextPaths: com.myapp.model, com.myapp.model2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment