我有一个控制器:
@Controller
@RequestMapping("/player")
public class PlayerController extends AbstractController {
@RequestMapping(value = "/doSomething", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(value = HttpStatus.OK)
@ResponseBody
public int doSomeThing(@RequestBody SomeDTO someDTO , HttpServletRequest request) throws IOException {
this.playerService.doSomething(
someDTO );
return SERVER_OK;
}
// Tons of similar methods here
}
我想创建一个过滤器,它将拦截对此控制器的所有调用,并且可以访问每个方法接收的@RequestBody
Object对象。我想操纵这个@RequestBody
对象。
这可能吗?