@RequestMapping(path = "/api/listaEstu", method = RequestMethod.POST) @ResponseBody public void guardar( @ModelAttribute ListaEstu alumno, @ModelAttribute("alumno_id") Long alumnoId) { Alumno alum = alumnoDao.obtener(alumnoId); alumno.setAlumno(alum); listaestuDao.agregar(alumno); }
@RequestMapping(path = "/api/listaEstu/{id}", method = RequestMethod.PUT) @ResponseBody public void editar( @PathVariable Long id, @ModelAttribute ListaEstu alumno, @ModelAttribute("alumno_id") Long profesorId) { Alumno alum = alumnoDao.obtener(profesorId); alumno.setAlumno(alum); alumno.setId(id); listaestuDao.editar(alumno); }