Spring MVC View post

This commit is contained in:
saroff
2020-04-25 12:34:18 +03:00
parent c15844550e
commit 7ccdf4733d
@@ -34,4 +34,14 @@ public class PersonController {
model.addAttribute("person", person);
return "edit";
}
@PostMapping("/edit")
public String savePerson(
Person person,
Model model
) {
Person saved = repository.save(person);
model.addAttribute(saved);
return "edit";
}
}