wood burning stoves*
The moose likes Spring and the fly likes For a POST request how to get the @Requestbody details in the interceptor. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "For a POST request how to get the @Requestbody details in the interceptor." Watch "For a POST request how to get the @Requestbody details in the interceptor." New topic
Author

For a POST request how to get the @Requestbody details in the interceptor.

rinku das
Greenhorn

Joined: Oct 12, 2012
Posts: 1
Hi,

Question : In my interceptor how do I get the post request details that is annotated with @Requestbody, so that I can perform some operation on the data of the request body that is passed.

Below is the code my code sample.

I have an interceptorbelow code)

public class TestInterceptor extends HandlerInterceptorAdapter {

@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {

logger.info("Before handling the request");
return super.preHandle(request, response, handler);
}


I have a contoller class as below

@Controller
public class TestController{

@RequestMapping(method = RequestMethod.POST, value = "/Test")
@ResponseBody
public ResponseEntity<Source> getTestSearch(
@RequestParam(required = false, value = "resultSetSize") Integer resultSetSize,
@RequestBody Source request) {

{
//code
}
}


Please provide a solution for this.

Thanks
rinku

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: For a POST request how to get the @Requestbody details in the interceptor.