This registration form for Physician, so 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 the @ModelAttribute of 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
Has anyone ever done anything like this?