Spring MVC Neither BindingResult nor plain target object for bean name

后端 未结 4 1776
小鲜肉
小鲜肉 2021-01-05 19:59

For some reason I cannot seem to fix this issue, even after looking at multiple examples on here.

I am trying to handle a form using Spring 3 MVC, but I am getting t

4条回答
  •  孤城傲影
    2021-01-05 20:20

    For me this error was resolved by declaring

    @ModelAttribute("person")
    public Person createFormModelAttribute() {
        return new Person();
    }
    

    in the controller. And also on the jsp, I refer to the model attributes by referencing the class name:

    
    

提交回复
热议问题