Monday, August 20, 2012

what is the default Handler Mapping in Spring MVC?

The default handler mapping used by DispatcherServlet is BeanNameUrlHandlerMapping, which uses the bean name as the URL pattern

ex:
http://localhost:8080/home.htm


<bean name="/home.htm" class="com.suresh.controller.HelloWorldController">
</bean>

We can give multiple mappings to Bean

<bean name="/home.htm /home.html /HomePage.htm" class="com.suresh.controller.HelloWorldController">
</bean>

No comments:

Post a Comment