I have some problems wth autowire annotation. My app looks like this:
Here is controller:
@Controller
public class MyController {
@Autowired
@Qua
You should include this section of XML code in spring-config.xml
:
but you should know the difference between
vs
as most people are suggesting these two :
1) First big difference between both tags is that
is used to activate applied annotations in already registered beans in application context. Note that it simply does not matter whether bean was registered by which mechanism e.g. using
or it was defined in application-context.xml
file itself.
2) Second difference is driven from first difference itself. It does register the beans in context + it also scans the annotations inside beans and activate them. So
; does what
does, but additionally it scan the packages and register the beans in application context.