spring mvc 1个项目怎样使用多个urlmapping

寂寞空虚党 2012-05-22 10:09:55
rt 比如 ,我既想用 BeanNameUrlHandlerMapping ,有的又想使用SimpleUrlHandlerMapping,该怎么配置
...全文
182 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
寂寞空虚党 2012-08-14
  • 打赏
  • 举报
回复
怎么没有回复的
  • 打赏
  • 举报
回复
上面这个东西是自动扫描.json的controller
手动配置太费劲,也没必要。
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

<mvc:annotation-driven />
<context:component-scan base-package="com.ce.stockgn.controller"></context:component-scan>

<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*.json"/>
<bean class="com.xx.aaaaaa.handlerInterceptor.SecretInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>

</beans>

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧