title: can @Valid annotation check on fields recursively in spring mvc?
body: <p>I make a model object with some JSR-303 validator annotation:</p>
  
  <pre><code>public class UserInfoBasicModel  implements Serializable{
      @NotNull(message="cannot be null")
      @NotEmpty(message="cannot be empty")
      private String name;
      //getter and setter
      //..ignored..
  }
  </code></pre>
  
  <p>Auto data-binding it in a controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/user")
  public class UserController  {
      @RequestMapping(method = RequestMethod.POST, value = "/registry/")
      public String registry(HttpServletRequest request,
              ModelMap modelMap,
              @Valid UserInfoBasicModel userInfoBasicModel,
              BindingResult result)    {
          //...some code here...
      }
  }
  </code></pre>
  
  <p>In the above scenario, it works fine for the validation. But when I encapsulate the model into another object just as below, the validation on UserInfoBasicModel doesn't work anymore:</p>
  
  <p>the Object that encapsulates the UserInfoBasicModel object:</p>
  
  <pre><code>public static class UserUpdateFormTransmitter       {
      @Valid
      private UserInfoBasicModel userInfoBasicModel;
      //getter and setter
      //..ignored..
  }
  </code></pre>
  
  <p>the controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/user")
  public class UserController  {
      @RequestMapping(method = RequestMethod.POST, value = "/registry/")
      public String registry(HttpServletRequest request,
              ModelMap modelMap,
              @Valid UserUpdateFormTransmitter userUpdateFormTransmitter,
              BindingResult result)    {
          //...some code here...
      }
  }
  </code></pre>
  
  <p>I'm wondering why doesn't the @valid annotaion works recursively just like what <a href="http://beanvalidation.org/1.0/spec/#constraintdeclarationvalidationprocess-validationroutine-graphvalidation" rel="noreferrer">JSR 303: Bean Validation</a> says.Could any one give me a solution so that I can valid my object recursively, thanks a lot!!!!</p>