Restful风格
Restful风格
//传统的RequestMapping请求的传参
//http://localhost/8080/test?a=1&b=2
@RequestMapping("/test")
public void test(int a,int b){};
//Restful风格的RequestMapping请求传参
//http://localhost/8080/test/1/2
@RequestMapping("/test/{a}/{b}")
public void test(@PathVariable int a,@PathVariable int b){};
//通过添加@PathVariable注解使得可以直接参数值


浙公网安备 33010602011771号