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', \
...




13 comments:

  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
  2. Thank you for sharing this helpful guide on creating an executable JAR file from a Java project. Executable JAR files allow developers to package compiled classes and resources into a single file that can be run directly using the Java runtime.
    Articles like this are very useful for developers learning Java packaging and deployment. Programs like Login360 help learners gain practical skills in
    Data Science and Full Stack Development

    ReplyDelete
  3. Practical insights like this are really helpful for anyone working with configuration in real projects. That same hands‑on learning approach matters in broader tech skills too. Programs like Login360 help with real exposure: their Java Course and Python Course focus on real‑world skills.

    ReplyDelete
  4. For those who are also working on strengthening their programming fundamentals, you might find this helpful:
    Java Course for Beginners

    Thanks for sharing such insightful technical content—looking forward to more posts!

    ReplyDelete
  5. Thanks for sharing such useful information. Found this helpful too: Digital Marketing Training in Chennai

    ReplyDelete
  6. Easy to understand and follow along.
    I appreciate the clarity in your writing.
    For those interested, visit:
    Data Science Course with Placement
    And also:
    Best IT Training Institute in Coimbatore

    ReplyDelete
  7. This UI UX Design resource is informative.
    It focuses on usability and interaction design.
    A valuable guide.

    ReplyDelete
  8. This guide is very helpful for beginners starting email campaigns.
    Check out this resource: Email Marketing Best Practices for Beginners

    ReplyDelete