How Configure XML in Spring explain with example?

Configure XML in Spring:

You’ll recall that Spring Framework manages beans, and that is the primary thing you’ll configure whenever you configure Spring Framework. You’ll write some of these beans yourself, like GreetingServiceImpl and HelloController. Other beans are default framework beans that come with Spring Framework, such as implementations of Spring’s ApplicationContext, ResourceLoader, BeanFactory, MessageSource, and ApplicationEventPublisher classes, just for starters.

To tell Spring how to configure all these beans, you use the XML namespace, demonstrated in the Spring-One-Context-XML-Config project. Take a look at its /WEB-INF/servletContext.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<mvc:annotation-driven />
<bean name="greetingServiceImpl" class="com.wrox.GreetingServiceImpl" />
<bean name="helloController" class="com.wrox.HelloController">
<property name="greetingService" ref="greetingServiceImpl" />