Reputation: 12232
This should be simple but I don't manage to get it working.
I have field annotated with @resource:
public class foo {
@Resource(name = "configMap")
private Map<String, String> config;
}
In applicationContext.xml I have (to be populated with Maven:
<context:annotation-config />
<util:map id="configMap" map-class="java.util.HashMap">
<entry key="url" value="${url}"></entry>
</util:map>
But at run time this doesn't work, the config field remains null. Any advices?
Edit: I am using Spring 3.0 and it is an existing project so I can't tell right away if there is some bizarre config elsewhere preventing this from working.
Upvotes: 1
Views: 5146
Reputation: 30865
Have You included the context name space to your beans definition ?
xmlns:context="http://www.springframework.org/schema/context"
Upvotes: 1