permaculture playing cards*
The moose likes Spring and the fly likes Injecting a Map in enum through Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Injecting a Map in enum through Spring" Watch "Injecting a Map in enum through Spring" New topic
Author

Injecting a Map in enum through Spring

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Hi All,

I have an Enum with few maps in it. Can I inject the maps through Spring? I am using Spring 2.5

Thanks


Be Humble... Be Nice.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Enums are basically static, you cannot inject beans into them. I can think of a few hacks that might get a reference to a bean into an enum, but you can not inject it directly. You might wan't to think about the design of you application first though and see if there is a better way.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Injecting a Map in enum through Spring