June 2018
Intermediate to advanced
408 pages
11h 23m
English
The XML-based configuration has been the primary configuration technique since Spring started. In this section, we will see the same example as we discussed in the DI pattern, and see how the CustomerService object is injected in the BankingService class through an XML-based configuration.
For an XML-based configuration, we need to create an applicationContext.xml file with a <beans> element. The Spring container must be able to manage one or more beans in the application. Beans are described using the <bean> element inside a top-level <beans> element.
Following is the applicationContext.xml file:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
Read now
Unlock full access