Add value into request object before validation
问题 I'm using @Restcontroller and @Vaid annotation. @RequestMapping(path = "/1050" method = RequestMethod.POST, headers = {"Content-Type=application/json"}, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public UserListResp getUserList(@RequestBody @Valid UserListReq request, BindingResult bindingResult, Principal principal){ UserListResp response = new UserListResp(); if (bindingResult.hasErrors()){ response.setResultCode(102); // Validation