Sunday, September 22, 2013

Different ways of validating @RequestBody in Spring MVC with @Valid annotation

In Spring MVC the @RequestBody annotation indicates a method parameter should be bound to a body of the request. @RequestBody parameter can treated as any other parameter in a @RequestMapping method and therefore it can also be validated by a standard validation mechanism.

In this post I will show 3 ways of validating the @RequestBody parameter in your Spring MVC application.