Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inject hashmap into controller  RSS feed

 
Gilbert Jones
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty new to Spring. I'm trying to inject a hashmap defined in a properties file into a field in a controller defined with @controller annotation. I'm not sure how to do this, so any suggestions would be welcome.

I also tried to define the keys and values directly in the spring config file, they were injected correctly into the class initially, but the map was wiped out since the controller was recreated through the controller annotation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!