Fix #110 owner and pet validators failed

This commit is contained in:
Antoine Rey 2015-10-28 08:30:44 +01:00
parent dd552f4970
commit 4aa89ae4e2
2 changed files with 2 additions and 2 deletions

View file

@ -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 {

View file

@ -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";