Difference between <context:annotation-config /> and <context:component-scan base-package="com.dtv.compare.output.controller" />
@Autowired
@Qualifier("AdminBasReportServiceImpl")
private AdminBasReportService adminBasReportService;
@Autowired
@Qualifier("FaculityBasServiceImpl")
private FaculityBasService faculityBasService;
}
In above code auto wiring will take place only when above bean is instantiated using XML file and XML file must include tag
<context:annotation-config />
Reason : Because above class AdminReportController is not annotated with annotation like
@Component, @Service , @Repository etc......
Thanks for the difference. It is a great one!
ReplyDelete