Often times, you may mix use of multiple handler mappings strategy in Spring MVC development.
For example, use ControllerClassNameHandlerMapping
to map all the convention handler mappings, and SimpleUrlHandlerMapping
to map other special handler mappings explicitly.
/index.htm=welcomeController /welcome.htm=welcomeController /main.htm=welcomeController /home.htm=welcomeController
In above case, it’s important to specify the handler mapping priority, so that it won’t cause the conflict. You can set the priority via the “order
” property, where the lower order value has the higher priority.