Skip to content
Snippets Groups Projects
Commit 4aa89ae4 authored by Antoine Rey's avatar Antoine Rey
Browse files

Fix #110 owner and pet validators failed

parent dd552f49
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,7 @@ public class OwnerController { ...@@ -111,7 +111,7 @@ public class OwnerController {
} }
@RequestMapping(value = "/owners/{ownerId}/edit", method = RequestMethod.POST) @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()) { if (result.hasErrors()) {
return "owners/createOrUpdateOwnerForm"; return "owners/createOrUpdateOwnerForm";
} else { } else {
......
...@@ -98,7 +98,7 @@ public class PetController { ...@@ -98,7 +98,7 @@ public class PetController {
} }
@RequestMapping(value = "/pets/{petId}/edit", method = RequestMethod.POST) @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()) { if (result.hasErrors()) {
model.put("pet", pet); model.put("pet", pet);
return "pets/createOrUpdatePetForm"; return "pets/createOrUpdatePetForm";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment