<?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"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
               http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">


    <context:component-scan base-package="com.baeldung.spring.controller"/>

    <!-- Start: Mapping by bean name (BeanNameUrlHandlerMapping) -->
    <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
        <property name="order" value="1"/>
    </bean>

    <bean name="/hello*.htm" class="com.baeldung.spring.controller.HelloWorldController"/>
    <!-- End: Mapping by bean name (BeanNameUrlHandlerMapping) -->

    <!-- Start: Mapping by SimpleUrlHandlerMapping -->

    <!-- Method 1 – Using Value -->
    <!-- <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings"> <value> /welcome.htm=welcomeController /welcome*=welcomeController
        </value> </property> <property name="order" value="2" /> </bean> -->

    <!-- Method 2 – Using prop key -->
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/welcome.htm">welcomeController</prop>
                <prop key="/welcome*">welcomeController</prop>
                <prop key="/hello*">helloController</prop>
            </props>
        </property>
        <property name="order" value="2"/>
    </bean>

    <bean id="welcomeController" class="com.baeldung.spring.controller.WelcomeController"></bean>
    <bean id="helloController" class="com.baeldung.spring.controller.HelloController"/>
    <!-- End: Mapping by SimpleUrlHandlerMapping -->

    <!-- Start: Mapping by ControllerClassNameHandlerMapping -->
    <bean
            class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
        <property name="caseSensitive" value="true"/>
        <property name="order" value="0"/>
    </bean>

    <bean class="com.baeldung.spring.controller.HelloGuestController"/>
    <!-- End: Mapping by ControllerClassNameHandlerMapping -->

    <!-- Start: Mapping by ControllerClassNameHandlerMapping with prefix -->
    <!-- <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
        <property name="caseSensitive" value="true" /> <property name="order" value="0"
        /> <property name="pathPrefix" value="/login" /> </bean> <bean class="com.baeldung.spring.controller.HelloGuestController"
        /> -->
    <!-- End: Mapping by ControllerClassNameHandlerMapping with prefix -->


</beans>