传统的前端传参:
<a href="xxx?age=1&name=zhangsan">传统</a>
传统的参数接收:
@RequestMapping("xxx")
public String xxx( int age,String name){
System.out.println("执行xxx方法"+name+"--"+age);
return "a.jsp";
}
restful前端传参:
<a href="yyy/1/zhangsan">restful</a>
restful的参数接收:
@RequestMapping("yyy/{age}/{name}")
public String yyy(@PathVariable int age, @PathVariable String name){
System.out.println("执行yyy方法"+name+"--"+age);
return "/a.jsp";
}