Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 interceptor:(below code)

public class TestInterceptor extends HandlerInterceptorAdapter {

public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {"Before handling the request");
return super.preHandle(request, response, handler);

I have a contoller class as below

public class TestController{

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


Please provide a solution for this.


All of life is a contant education - Eleanor Roosevelt. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic