データベースにレコードを挿入したいので、これが私のコントローラです:
@RequestMapping(value="/ajouter_activite",method = RequestMethod.POST)
public String AddActivity(@ModelAttribute Movement movement, ModelMap model,BindingResult result){
AddActivityValidator actvalidator = new AddActivityValidator();
actvalidator.validate(movement, result);
if(!result.hasErrors()){
boolean n;
n=actservice.addMovement(movement);
if(n==true){model.addAttribute("success","true");}
else {model.addAttribute("echec","true");}
return "/FicheService";}
else{return "/FicheService";
}
}
フォームを送信すると、次の例外が発生します。
Etat HTTP 500 - Request processing failed; nested exception is org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public java.lang.String gestion.delegation.controller.FicheServiceController.AddActivity(gestion.delegation.domaine.Movement,org.springframework.ui.ModelMap,org.springframework.validation.BindingResult)]; nested exception is java.lang.IllegalStateException: Errors/BindingResult argument declared without preceding model attribute. Check your handler method signature!
それのどこが間違っているのですか?