Spring MVC的@RequestMapping多个URL映射到同一个方法
标记了@RequestMapping 注解的方法,更改 url 的时候特别有用
目的:一个方法对应多个 url
改之前
@RequestMapping("")
public String index(HttpServletRequest request, Model model) { return "index" }
@RequestMapping("index")
public String index(HttpServletRequest request, Model model) { return "index" }
改之后 @RequestMapping(value={"index",""})
public String index(HttpServletRequest request, Model model) { return "index" }