mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-17 09:29:37 +00:00
Update PetController.java
This commit is contained in:
parent
216a44cc06
commit
caf296b34c
1 changed files with 0 additions and 10 deletions
|
@ -50,11 +50,6 @@ class PetController {
|
||||||
this.owners = owners;
|
this.owners = owners;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModelAttribute("types")
|
|
||||||
public Collection<PetType> populatePetTypes() {
|
|
||||||
return this.owners.findPetTypes();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ModelAttribute("owner")
|
@ModelAttribute("owner")
|
||||||
public Owner findOwner(@PathVariable("ownerId") int ownerId) {
|
public Owner findOwner(@PathVariable("ownerId") int ownerId) {
|
||||||
|
|
||||||
|
@ -85,11 +80,6 @@ class PetController {
|
||||||
dataBinder.setDisallowedFields("id");
|
dataBinder.setDisallowedFields("id");
|
||||||
}
|
}
|
||||||
|
|
||||||
@InitBinder("pet")
|
|
||||||
public void initPetBinder(WebDataBinder dataBinder) {
|
|
||||||
dataBinder.setValidator(new PetValidator());
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/pets/new")
|
@GetMapping("/pets/new")
|
||||||
public String initCreationForm(Owner owner, ModelMap model) {
|
public String initCreationForm(Owner owner, ModelMap model) {
|
||||||
Pet pet = new Pet();
|
Pet pet = new Pet();
|
||||||
|
|
Loading…
Reference in a new issue