Friday, February 12, 2016

Using property files with map values in Spring configuration beans

Spring and Spring Boot can map property files as configuration beans automatically. What is less known is that it can easily wire Map objects too:


@Configuration
@Component
@PropertySource("classpath:config.properties")
public class Config {
    @Value("#{${my.map}}")
    private Map map;
...





my.map={\
'key1' : 'val1', \
'key2' : 'val2', \
...




1 comment:

  1. The details mentioned in our review additionally be} subject to change as casinos seek to enhance their sites to offer their patrons a better gambling experience. We 코인카지노 did, however, discover their weekly Joker Race to be a fantastic bankroll praise. There aren’t many table game-specific bonuses like this one that may put you in contention for successful huge swimming pools of comp points that can be be} redeemed for cash. Let’s face it, we’re never going to waste all our ammo in one battle of our on-line gambling journey – so having multi-tiered deposit bonuses is a big plus.

    ReplyDelete