我已经实现了Jaxb2RootElementHttpMessageConverter,用于将XML请求转换为我的java对象,并且它可以工作。我的控制器看起来像
@RequestMapping(value = "/post", method = RequestMethod.POST)
public MyResponse post(@RequestBody MyRequest request, BindingResult result)
我想同时收到用于存储日志的原始xml请求和用于验证的转换后的java对象以及
等其他进程@RequestMapping(value = "/post", method = RequestMethod.POST)
public MyResponse post(@RequestBody String originalRequest, @RequestBody @Valid MyRequest request, BindingResult result)
我试图将响应体作为HttpServletRequest的InputStream,但我得到IOException: Stream closed
如果我想这样做怎么做Spring会转换和验证而不是我的代码?