I'm having some issues with injection in the application I'm working on (using Spring Version 3.1.2). To start with, I'm seeing a lot of code like this:
@Value("#{searchRequestBean}")
private SearchRequest searchRequest;
@Value("#{searchResponseBean}")
private SearchResponse searchResponse;
@Autowired
private SavedSearchService service;
Each of these three appears to have the effect of autowiring the specified bean/service into the class. What I don't understand is, what's the difference between @Value
and @Autowired
in these cases? Every example I find online seems to use @Value
to inject values from a properties file. In this case, SearchResponse
and SearchRequest
are abstract classes.
I'm hoping that a better understanding of this will help me solve some issues I'm having with my Session bean.