mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-28 14:19:38 +00:00
Fix #110 owner and pet validators failed
This commit is contained in:
parent
dd552f4970
commit
4aa89ae4e2
2 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ public class OwnerController {
|
|||
}
|
||||
|
||||
@RequestMapping(value = "/owners/{ownerId}/edit", method = RequestMethod.POST)
|
||||
public String processUpdateOwnerForm(@Valid Owner owner, @PathVariable("ownerId") int ownerId, BindingResult result) {
|
||||
public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId) {
|
||||
if (result.hasErrors()) {
|
||||
return "owners/createOrUpdateOwnerForm";
|
||||
} else {
|
||||
|
|
|
@ -98,7 +98,7 @@ public class PetController {
|
|||
}
|
||||
|
||||
@RequestMapping(value = "/pets/{petId}/edit", method = RequestMethod.POST)
|
||||
public String processUpdateForm(@Valid Pet pet, Owner owner, BindingResult result, ModelMap model) {
|
||||
public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) {
|
||||
if (result.hasErrors()) {
|
||||
model.put("pet", pet);
|
||||
return "pets/createOrUpdatePetForm";
|
||||
|
|
Loading…
Reference in a new issue