From what I can tell this is set up correctly but I am getting the following error:
java.lang.IllegalStateException: Neither BindingResult nor plain target
Model attribute has to be initialized (using GET method) before calling post method.
In your case you need one more method in controller which does model.addAttribute("person",new Person());
and it has to be called before post.
Refer below link: https://spring.io/guides/gs/handling-form-submission/ OR http://forum.thymeleaf.org/Neither-BindingResult-nor-plain-target-object-for-bean-name-miniDoniie-available-as-request-attribute-td4027859.html
It has GetMapping
as well as PostMapping
in controller.