diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerListResource.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerListResource.java index 8054fc8f0..ae7782be9 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerListResource.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerListResource.java @@ -17,17 +17,10 @@ package org.springframework.samples.petclinic.web; import java.util.Collection; -import javax.validation.Valid; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.service.ClinicService; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.WebDataBinder; -import org.springframework.web.bind.annotation.InitBinder; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java index 4fe3bb80d..966a8a43e 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java @@ -56,10 +56,8 @@ public class OwnerResource { } // TODO: should be improved so we have a single method parameter - @RequestMapping(value = "/owner/{ownerId}", method = RequestMethod.POST) + @RequestMapping(value = "/owner/{ownerId}", method = RequestMethod.PUT) public Owner updateOwner(@ModelAttribute Owner ownerModel, @RequestBody Owner ownerRequest) { - // seems like a workaround. I haven't found a proper way to inject to have @ModelAttribute pupulate object - // first and then have the delta come from @RequestBody ownerModel.setFirstName(ownerRequest.getFirstName()); ownerModel.setLastName(ownerRequest.getLastName()); ownerModel.setCity(ownerRequest.getCity()); diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index fd98c965a..7a0d87412 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -7,10 +7,9 @@ - - + @@ -19,11 +18,11 @@
- + - + - +