What is the difference between Spring BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping?
After going through some site I understand that BeanNameUrlHandlerMapping is the default HandlerMapping for DispatcherServlet.
Also in BeanNameUrlHandlerMapping you can directly map url with Controller.
but same thing can be done with SimpleUrlHandlerMapping as well.
I know something but not that much clear, that it has to do something with
name accepts / but id can't.....but i am confused.
what is the exact diffrence? what is the need of SimpleUrlHandlerMapping?
please explain...Thanks.
We have to register more than one urls if we want map more than one url to be mapped to a single controller class and this is not a good way to work with Spring IoC.
SimpleUrlHandlerMapping is a simple way to define url mapping using a map or property bean. This simplify the url mapping in Spring MVC.
Example BeanUrlHandlerMapping
Important:
Example SimpleUrlHandlerMapping
Important: