This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Inject hashmap into controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Inject hashmap into controller" Watch "Inject hashmap into controller" New topic
Author

Inject hashmap into controller

Gilbert Jones
Greenhorn

Joined: Dec 15, 2011
Posts: 1
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inject hashmap into controller
 
Similar Threads
How to pass an object between MVC controllers?
Spring 3 and Tomcat...newbie question
nonintrusive in spring