场景:一些不需要渲染界面的方法
目的: 限定访问方式(比如只能以get,或者只能以post方法进行访问)
代价:复制粘贴
栗子:
@RequestMapping(value="post",method=RequestMethod.POST)
@ResponseBody
public String post() {
return "post";
}
@RequestMapping注解的method参数,限制了访问的方式
场景:一些不需要渲染界面的方法
目的: 限定访问方式(比如只能以get,或者只能以post方法进行访问)
代价:复制粘贴
栗子:
@RequestMapping(value="post",method=RequestMethod.POST)
@ResponseBody
public String post() {
return "post";
}
@RequestMapping注解的method参数,限制了访问的方式