Tuesday 3 November 2015

Difference between context:annotation-config and context:component-scan base-package="com.dtv.compare.output.controller"


     public class AdminReportController {

@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......





1 comment: