@RequestMapping(value = "/update") public @ResponseBody ResponseObject update( @RequestBody @Valid Product product, BindingResult errors) throws Exception { if (errors.hasErrors()) throw new ValidateException(errors.getAllErrors().get(0).getDefaultMessage()); return productService.update(product); }