Configure the handler mapping priority in Spring MVC
来源:互联网 发布:外贸英语的软件 编辑:程序博客网 时间:2024/05/20 15:42
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.
<beans ...> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <value> /index.htm=welcomeController /welcome.htm=welcomeController /main.htm=welcomeController /home.htm=welcomeController </value> </property> <property name="order" value="0" /> </bean> <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" > <property name="caseSensitive" value="true" /> <property name="order" value="1" /> </bean> <bean id="welcomeController" class="com.mkyong.common.controller.WelcomeController" /> <bean class="com.mkyong.common.controller.HelloGuestController" /></beans>
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.
0 0
- Configure the handler mapping priority in Spring MVC
- Configure multiple view resolvers priority in Spring MVC
- Configure multiple view resolvers priority in Spring MVC
- Spring MVC教程 映射处理器Handler Mapping
- Configure the LACP Port Priority
- Configure the LACP System Priority
- 第三集 Spring MVC教程 映射处理器Handler Mapping
- The thread priority in UI application
- spring MVC handler
- Spring MVC Handler Interceptor
- spring mvc3中几个Handler Mapping的
- spring mvc No mapping found for HTTP request with URI [] in DispatcherServlet
- how to configure spring mvc 三 to not return “null” object in json response
- spring MVC 访问静态资源报No handler mapping found for的解决(从ITEYE搬家过来的)
- The Life of a request in Spring MVC
- Spring MVC 异常Ambiguous mapping found
- Spring MVC handler interceptors example
- spring mvc annotation and i18n configure
- iOS开发系列之Objective-C基础:NSString字符串类型(二)
- swift 类型定义
- mysql数据同步
- 网站每天被抓取新页面的经验心得ccxtqj
- Spring MVC SimpleUrlHandlerMapping example
- Configure the handler mapping priority in Spring MVC
- 网站优化不要经常更换空ccxtqj间
- 3.3 声明和使用常量;3.4 术语
- [150826]Maven详解之聚合与继承
- 【HDOJ 4272】 LianLianKan (vector深搜+剪枝)
- hdu5412--CRB and Queries(整体二分)
- 05==数组(查找,添加,删除,排序)
- ZOJ3876 May Day Holiday
- VC中基于Windows的精确定时