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="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<mvc:annotation-driven />
<bean name="greetingServiceImpl" class="com.wrox.GreetingServiceImpl" />
<bean name="helloController" class="com.wrox.HelloController">
<property name="greetingService" ref="greetingServiceImpl" />
</bean>
</beans>