0
This Physician registration screen, then I created this modal for the user to register specialties.
@GetMapping("/cadastro")
public ModelAndView preSalvar(@ModelAttribute("medico") Medico medico,@ModelAttribute Especialidade especialidade){
return new ModelAndView("home","conteudo","medico/add");
}
I added @Modelattribute from the specialty, and the specialty form with th:Object="${specialty}" but is giving this exception : java.lang.Illegalstateexception: Neither Bindingresult nor Plain target Object for bean name 'specialty' available as request attribute
Someone has done something similar?
The exception is when I click to register in the doctor’s form
– Henrique Santos
I believe that the most correct approach would be to separate in two Forms: one for the main page and the other for the modal.
– danieltc07