使用注解方式@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){......}