diff --git a/src/main/java/org/springframework/samples/petclinic/owner/Pet.java b/src/main/java/org/springframework/samples/petclinic/owner/Pet.java index 5aa038eb3e4..8fa1bd6eb6c 100755 --- a/src/main/java/org/springframework/samples/petclinic/owner/Pet.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/Pet.java @@ -32,7 +32,6 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.samples.petclinic.model.NamedEntity; -import org.springframework.samples.petclinic.visit.Visit; /** * Simple business object representing a pet. diff --git a/src/main/java/org/springframework/samples/petclinic/owner/Visit.java b/src/main/java/org/springframework/samples/petclinic/owner/Visit.java index 5266f6137ea..c09aa810e2a 100755 --- a/src/main/java/org/springframework/samples/petclinic/owner/Visit.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/Visit.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.samples.petclinic.visit; +package org.springframework.samples.petclinic.owner; import java.time.LocalDate; diff --git a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java index 508fde6eebb..6fcae57da4d 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java @@ -19,7 +19,6 @@ import javax.validation.Valid; -import org.springframework.samples.petclinic.visit.Visit; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.WebDataBinder; @@ -63,6 +62,7 @@ public Visit loadPetWithVisit(@PathVariable("ownerId") int ownerId, @PathVariabl Owner owner = this.owners.findById(ownerId); Pet pet = owner.getPet(petId); model.put("pet", pet); + model.put("owner", owner); Visit visit = new Visit(); pet.addVisit(visit); return visit; @@ -78,12 +78,11 @@ public String initNewVisitForm(@PathVariable("petId") int petId, Map