采用的, 请求PUT和DELETE抛掷异常,PUT请求代码如下:
@RequestMapping(value="/testREST/{id}", method=RequestMethod.PUT) public String testRESTPut(@PathVariable Integer id){ System.out.println("test REST PUT: "+ id); return SUCCESS; }
如上可以请求,正常调用方法处理,返回success对应的JSP,状态异常:
type Status report
message JSPs only permit GET POST or HEAD
description The specified HTTP method is not allowed for the requested resource.
如果把请求变成@ResponseBody则正常。
REST风格返回一定是@ResponseBody,不能返回页面吗?