Defining the XML Spring configuration

The following example shows a typical XML Spring configuration. This configuration file is created in the src/main/resources directory with the name BusinessApplicationContext.xml:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>     <beans>  <!-Namespace definitions removed-->       <context:component-scan base-package ="com.mastering.spring"/>     </beans>

The component scan is defined using context:component-scan.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.