Skip to content

Commit 4aa89ae

Browse files
committed
Fix spring-projects#110 owner and pet validators failed
1 parent dd552f4 commit 4aa89ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/springframework/samples/petclinic/web/OwnerController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model mo
111111
}
112112

113113
@RequestMapping(value = "/owners/{ownerId}/edit", method = RequestMethod.POST)
114-
public String processUpdateOwnerForm(@Valid Owner owner, @PathVariable("ownerId") int ownerId, BindingResult result) {
114+
public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId) {
115115
if (result.hasErrors()) {
116116
return "owners/createOrUpdateOwnerForm";
117117
} else {

src/main/java/org/springframework/samples/petclinic/web/PetController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public String initUpdateForm(@PathVariable("petId") int petId, ModelMap model) {
9898
}
9999

100100
@RequestMapping(value = "/pets/{petId}/edit", method = RequestMethod.POST)
101-
public String processUpdateForm(@Valid Pet pet, Owner owner, BindingResult result, ModelMap model) {
101+
public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) {
102102
if (result.hasErrors()) {
103103
model.put("pet", pet);
104104
return "pets/createOrUpdatePetForm";

0 commit comments

Comments
 (0)