您的位置:首页 > 编程语言 > Java开发

spring mvc配置不同的路径指向相同

2016-02-14 10:56 495 查看
使用注解方式@RequestMapping({“List-{pageIndex}.htm”,”List/{pageIndex}”}),即访问www.abc.com/List-1.htm和www.abc.com/List/1都是请求列表的第一页数据。配置“{pageIndex}”可获取到路径中的参数,

@RequestMapping({"List-{pageIndex}.htm","List/{pageIndex}"})
public String getArticleList(
@PathVariable("pageIndex") Integer pageIndex,
@RequestParam(defaultValue="")String refreshTime,
HttpServletRequest request,HttpServletResponse response){......}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring mvc 不同路径