From e38a9feebe1814ada460dea50ba45f11389fdc9f Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 10 Nov 2016 16:51:14 +0000 Subject: [PATCH] Convert to jar with thymeleaf --- pom.xml | 588 ++++++++---------- src/main/docker/Dockerfile | 8 - .../petclinic/PetClinicApplication.java | 13 +- .../samples/petclinic/model/Pet.java | 3 +- .../petclinic/repository/OwnerRepository.java | 4 +- .../petclinic/repository/PetRepository.java | 4 +- .../petclinic/service/ClinicServiceImpl.java | 18 +- .../petclinic/web/CrashController.java | 10 +- .../petclinic/web/CustomErrorController.java | 35 -- .../samples/petclinic/web/VetController.java | 19 +- .../petclinic/web/VisitController.java | 6 - .../{webapp/resources => }/less/header.less | 0 .../resources => }/less/petclinic.less | 4 +- .../resources => }/less/responsive.less | 0 .../resources => }/less/typography.less | 0 src/main/resources/application.properties | 4 +- .../resources/fonts/montserrat-webfont.eot | Bin .../resources/fonts/montserrat-webfont.svg | 0 .../resources/fonts/montserrat-webfont.ttf | Bin .../resources/fonts/montserrat-webfont.woff | Bin .../resources/fonts/varela_round-webfont.eot | Bin .../resources/fonts/varela_round-webfont.svg | 0 .../resources/fonts/varela_round-webfont.ttf | Bin .../resources/fonts/varela_round-webfont.woff | Bin .../static}/resources/images/favicon.png | Bin .../static}/resources/images/pets.png | Bin .../static}/resources/images/platform-bg.png | Bin .../images/spring-logo-dataflow-mobile.png | Bin .../resources/images/spring-logo-dataflow.png | Bin .../resources/images/spring-pivotal-logo.png | Bin src/main/resources/templates/error.html | 11 + .../templates/fragments/inputField.html | 26 + .../resources/templates/fragments/layout.html | 94 +++ .../templates/fragments/selectField.html | 29 + .../owners/createOrUpdateOwnerForm.html | 30 + .../templates/owners/findOwners.html | 35 ++ .../templates/owners/ownerDetails.html | 83 +++ .../templates/owners/ownersList.html | 33 + .../templates/pets/createOrUpdatePetForm.html | 38 ++ .../pets/createOrUpdateVisitForm.html | 61 ++ .../resources/templates/vets/vetList.html | 36 ++ src/main/resources/templates/welcome.html | 16 + src/main/webapp/WEB-INF/jetty-web.xml | 7 - src/main/webapp/WEB-INF/jsp/exception.jsp | 14 - .../jsp/owners/createOrUpdateOwnerForm.jsp | 34 - .../webapp/WEB-INF/jsp/owners/findOwners.jsp | 34 - .../WEB-INF/jsp/owners/ownerDetails.jsp | 98 --- .../webapp/WEB-INF/jsp/owners/ownersList.jsp | 48 -- .../jsp/pets/createOrUpdatePetForm.jsp | 51 -- .../jsp/pets/createOrUpdateVisitForm.jsp | 70 --- src/main/webapp/WEB-INF/jsp/vets/vetList.jsp | 44 -- src/main/webapp/WEB-INF/jsp/welcome.jsp | 14 - src/main/webapp/WEB-INF/tags/bodyHeader.tag | 7 - src/main/webapp/WEB-INF/tags/footer.tag | 15 - src/main/webapp/WEB-INF/tags/htmlHeader.tag | 34 - src/main/webapp/WEB-INF/tags/inputField.tag | 26 - src/main/webapp/WEB-INF/tags/layout.tag | 27 - src/main/webapp/WEB-INF/tags/menu.tag | 45 -- src/main/webapp/WEB-INF/tags/menuItem.tag | 13 - src/main/webapp/WEB-INF/tags/pivotal.tag | 10 - src/main/webapp/WEB-INF/tags/selectField.tag | 30 - src/main/webapp/bower_components/bower.json | 4 - src/main/webapp/resources/.gitignore | 1 - .../resources/css/jquery-ui.theme.min.css | 11 - .../petclinic/web/VisitControllerTests.java | 9 - 65 files changed, 778 insertions(+), 1076 deletions(-) delete mode 100644 src/main/docker/Dockerfile delete mode 100644 src/main/java/org/springframework/samples/petclinic/web/CustomErrorController.java rename src/main/{webapp/resources => }/less/header.less (100%) rename src/main/{webapp/resources => }/less/petclinic.less (97%) rename src/main/{webapp/resources => }/less/responsive.less (100%) rename src/main/{webapp/resources => }/less/typography.less (100%) rename src/main/{webapp => resources/static}/resources/fonts/montserrat-webfont.eot (100%) rename src/main/{webapp => resources/static}/resources/fonts/montserrat-webfont.svg (100%) rename src/main/{webapp => resources/static}/resources/fonts/montserrat-webfont.ttf (100%) rename src/main/{webapp => resources/static}/resources/fonts/montserrat-webfont.woff (100%) rename src/main/{webapp => resources/static}/resources/fonts/varela_round-webfont.eot (100%) rename src/main/{webapp => resources/static}/resources/fonts/varela_round-webfont.svg (100%) rename src/main/{webapp => resources/static}/resources/fonts/varela_round-webfont.ttf (100%) rename src/main/{webapp => resources/static}/resources/fonts/varela_round-webfont.woff (100%) rename src/main/{webapp => resources/static}/resources/images/favicon.png (100%) rename src/main/{webapp => resources/static}/resources/images/pets.png (100%) rename src/main/{webapp => resources/static}/resources/images/platform-bg.png (100%) rename src/main/{webapp => resources/static}/resources/images/spring-logo-dataflow-mobile.png (100%) rename src/main/{webapp => resources/static}/resources/images/spring-logo-dataflow.png (100%) rename src/main/{webapp => resources/static}/resources/images/spring-pivotal-logo.png (100%) create mode 100644 src/main/resources/templates/error.html create mode 100644 src/main/resources/templates/fragments/inputField.html create mode 100644 src/main/resources/templates/fragments/layout.html create mode 100644 src/main/resources/templates/fragments/selectField.html create mode 100644 src/main/resources/templates/owners/createOrUpdateOwnerForm.html create mode 100644 src/main/resources/templates/owners/findOwners.html create mode 100644 src/main/resources/templates/owners/ownerDetails.html create mode 100644 src/main/resources/templates/owners/ownersList.html create mode 100644 src/main/resources/templates/pets/createOrUpdatePetForm.html create mode 100644 src/main/resources/templates/pets/createOrUpdateVisitForm.html create mode 100644 src/main/resources/templates/vets/vetList.html create mode 100644 src/main/resources/templates/welcome.html delete mode 100644 src/main/webapp/WEB-INF/jetty-web.xml delete mode 100644 src/main/webapp/WEB-INF/jsp/exception.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/owners/createOrUpdateOwnerForm.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/owners/findOwners.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/owners/ownersList.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/vets/vetList.jsp delete mode 100644 src/main/webapp/WEB-INF/jsp/welcome.jsp delete mode 100644 src/main/webapp/WEB-INF/tags/bodyHeader.tag delete mode 100644 src/main/webapp/WEB-INF/tags/footer.tag delete mode 100644 src/main/webapp/WEB-INF/tags/htmlHeader.tag delete mode 100644 src/main/webapp/WEB-INF/tags/inputField.tag delete mode 100644 src/main/webapp/WEB-INF/tags/layout.tag delete mode 100644 src/main/webapp/WEB-INF/tags/menu.tag delete mode 100644 src/main/webapp/WEB-INF/tags/menuItem.tag delete mode 100644 src/main/webapp/WEB-INF/tags/pivotal.tag delete mode 100644 src/main/webapp/WEB-INF/tags/selectField.tag delete mode 100644 src/main/webapp/bower_components/bower.json delete mode 100644 src/main/webapp/resources/.gitignore delete mode 100644 src/main/webapp/resources/css/jquery-ui.theme.min.css diff --git a/pom.xml b/pom.xml index 1b6a5ed66..e0477cb62 100644 --- a/pom.xml +++ b/pom.xml @@ -1,340 +1,264 @@ - - 4.0.0 - org.springframework.samples - springboot-petclinic - 1.4.1 - + + 4.0.0 + org.springframework.samples + springboot-petclinic + 1.4.1 + + + org.springframework.boot + spring-boot-starter-parent + 1.4.1.RELEASE + + petclinic + + + + + 1.8 + UTF-8 + UTF-8 + + + 3.3.6 + 1.11.4 + 2.2.4 + + 3.0.2.RELEASE + 2.0.4 + + 2.7 + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.hsqldb + hsqldb + runtime + + + + + javax.cache + cache-api + + + org.ehcache + ehcache + + + + + org.webjars + webjars-locator + + + org.webjars + jquery + ${webjars-jquery.version} + + + org.webjars + jquery-ui + ${webjars-jquery-ui.version} + + + org.webjars + bootstrap + ${webjars-bootstrap.version} + + + + + org.springframework.boot + spring-boot-devtools + runtime + + + + + + org.springframework.boot - spring-boot-starter-parent - 1.4.1.RELEASE - - petclinic - war + spring-boot-maven-plugin + + + + + build-info + + + + ${project.build.sourceEncoding} + ${project.reporting.outputEncoding} + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + ${cobertura.version} + + + + + + + clean + check + + + + - + + + pl.project13.maven + git-commit-id-plugin + + + + revision + + + + + true + yyyy-MM-dd'T'HH:mm:ssZ + true + ${project.build.outputDirectory}/git.properties + + + - - 1.7 - UTF-8 - UTF-8 - arey + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-resources + + unpack + + + + + org.webjars + bootstrap + ${webjars-bootstrap.version} + false + ${project.basedir}/target/less + + **/*.less + + + + + + - - 3.3.6 - 1.11.4 - 2.2.4 + + maven-resources-plugin + + + copy-resources + validate + + copy-resources + + + ${project.build.directory}/less + + + src/main/less + true + + + + + + - 2.7 + + org.lesscss + lesscss-maven-plugin + 1.7.0.1.1 + + ${project.build.directory}/less + ${project.build.directory}/classes/static/resources/css + true + + petclinic.less + + + + + process-resources + + compile + + + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + ${cobertura.version} + + + html + + + + + + - - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-cache - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-web - - - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - javax.servlet - jstl - - - - - org.hsqldb - hsqldb - runtime - - - - - - - - javax.cache - cache-api - - - org.ehcache - ehcache - - - - - org.webjars - jquery - ${webjars-jquery.version} - - - org.webjars - jquery-ui - ${webjars-jquery-ui.version} - - - org.webjars - bootstrap - ${webjars-bootstrap.version} - - - - - - - - petclinic - install - - - org.springframework.boot - spring-boot-maven-plugin - - - - - build-info - - - - ${project.build.sourceEncoding} - ${project.reporting.outputEncoding} - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.0 - - - - - true - ${java.version} - ${java.version} - true - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.13 - - - **/*Tests.java - - - - - org.apache.maven.plugins - maven-eclipse-plugin - 2.9 - - true - true - 2.0 - - **/*.* - - - - org.springframework.ide.eclipse.core.springbuilder - - - org.eclipse.m2e.core.maven2Builder - - - - org.eclipse.jdt.core.javanature - org.springframework.ide.eclipse.core.springnature - org.eclipse.m2e.core.maven2Nature - - - - - org.codehaus.mojo - cobertura-maven-plugin - ${cobertura.version} - - - - - - - clean - check - - - - - - - - pl.project13.maven - git-commit-id-plugin - - - - revision - - - - - true - yyyy-MM-dd'T'HH:mm:ssZ - true - ${project.build.outputDirectory}/git.properties - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - process-resources - - unpack - - - - - org.webjars - bootstrap - 3.3.6 - false - ${project.basedir}/src/main/webapp/resources/generated - - **/*.less - - - - - - - - - - maven-clean-plugin - - - - ${project.basedir}/src/main/webapp/resources/generated - - - - - - - org.lesscss - lesscss-maven-plugin - 1.7.0.1.1 - - ${project.basedir}/src/main/webapp/resources/less - ${project.basedir}/src/main/webapp/resources/generated - true - - petclinic.less - - - - - process-resources - - compile - - - - - - com.spotify - docker-maven-plugin - 0.4.11 - - ${docker.image.prefix}/${project.artifactId} - src/main/docker - - - / - ${project.build.directory} - ${project.build.finalName}.war - - - true - - ${project.version} - latest - - true - - - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - ${cobertura.version} - - - html - - - - - - - - demopetclinic diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile deleted file mode 100644 index cbbf16299..000000000 --- a/src/main/docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM openjdk:alpine -MAINTAINER Antoine Rey -# Spring Boot application creates working directories for Tomcat by default -VOLUME /tmp -ADD petclinic.war petclinic.war -RUN sh -c 'touch /petclinic.war' -# To reduce Tomcat startup time we added a system property pointing to "/dev/urandom" as a source of entropy. -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/petclinic.war"] diff --git a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java index 456b061d4..80859de97 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java +++ b/src/main/java/org/springframework/samples/petclinic/PetClinicApplication.java @@ -18,23 +18,16 @@ package org.springframework.samples.petclinic; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; /** * PetClinic Spring Boot Application. * */ @SpringBootApplication -public class PetClinicApplication extends SpringBootServletInitializer { +public class PetClinicApplication { - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(PetClinicApplication.class); + public static void main(String[] args) throws Exception { + SpringApplication.run(PetClinicApplication.class, args); } - public static void main(String[] args) throws Exception { - SpringApplication.run(PetClinicApplication.class, args); - } - } diff --git a/src/main/java/org/springframework/samples/petclinic/model/Pet.java b/src/main/java/org/springframework/samples/petclinic/model/Pet.java index 205d529ff..d21db695e 100644 --- a/src/main/java/org/springframework/samples/petclinic/model/Pet.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Pet.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -62,7 +63,7 @@ public class Pet extends NamedEntity { private Owner owner; @OneToMany(cascade = CascadeType.ALL, mappedBy = "pet", fetch = FetchType.EAGER) - private Set visits; + private Set visits = new LinkedHashSet<>(); public void setBirthDate(Date birthDate) { diff --git a/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java index 841d0bcd8..4b0a0add1 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java @@ -17,11 +17,9 @@ package org.springframework.samples.petclinic.repository; import java.util.Collection; -import org.springframework.dao.DataAccessException; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.Repository; import org.springframework.data.repository.query.Param; -import org.springframework.samples.petclinic.model.BaseEntity; import org.springframework.samples.petclinic.model.Owner; /** @@ -51,7 +49,7 @@ public interface OwnerRepository extends Repository { * @return the {@link Owner} if found */ @Query("SELECT owner FROM Owner owner left join fetch owner.pets WHERE owner.id =:id") - Owner findById(@Param("id") int id); + Owner findById(@Param("id") Integer id); /** * Save an {@link Owner} to the data store, either inserting or updating it. diff --git a/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java index 58e73d7f6..2ddea85b7 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java @@ -17,10 +17,8 @@ package org.springframework.samples.petclinic.repository; import java.util.List; -import org.springframework.dao.DataAccessException; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.Repository; -import org.springframework.samples.petclinic.model.BaseEntity; import org.springframework.samples.petclinic.model.Pet; import org.springframework.samples.petclinic.model.PetType; @@ -47,7 +45,7 @@ public interface PetRepository extends Repository { * @param id the id to search for * @return the {@link Pet} if found */ - Pet findById(int id); + Pet findById(Integer id); /** * Save a {@link Pet} to the data store, either inserting or updating it. diff --git a/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java b/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java index f5ccbede6..5c2e47a3e 100644 --- a/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java @@ -29,8 +29,8 @@ import javax.cache.annotation.CacheResult; import java.util.Collection; /** - * Mostly used as a facade for all Petclinic controllers - * Also a placeholder for @Transactional and @CacheResult annotations + * Mostly used as a facade for all Petclinic controllers Also a placeholder + * for @Transactional and @CacheResult annotations * * @author Michael Isvy */ @@ -43,7 +43,8 @@ public class ClinicServiceImpl implements ClinicService { private VisitRepository visitRepository; @Autowired - public ClinicServiceImpl(PetRepository petRepository, VetRepository vetRepository, OwnerRepository ownerRepository, VisitRepository visitRepository) { + public ClinicServiceImpl(PetRepository petRepository, VetRepository vetRepository, OwnerRepository ownerRepository, + VisitRepository visitRepository) { this.petRepository = petRepository; this.vetRepository = vetRepository; this.ownerRepository = ownerRepository; @@ -74,14 +75,12 @@ public class ClinicServiceImpl implements ClinicService { ownerRepository.save(owner); } - @Override @Transactional public void saveVisit(Visit visit) throws DataAccessException { visitRepository.save(visit); } - @Override @Transactional(readOnly = true) public Pet findPetById(int id) throws DataAccessException { @@ -101,10 +100,9 @@ public class ClinicServiceImpl implements ClinicService { return vetRepository.findAll(); } - @Override - public Collection findVisitsByPetId(int petId) { - return visitRepository.findByPetId(petId); - } - + @Override + public Collection findVisitsByPetId(int petId) { + return visitRepository.findByPetId(petId); + } } diff --git a/src/main/java/org/springframework/samples/petclinic/web/CrashController.java b/src/main/java/org/springframework/samples/petclinic/web/CrashController.java index 29c55c1c0..303707b2c 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/CrashController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/CrashController.java @@ -23,18 +23,16 @@ import org.springframework.web.bind.annotation.RequestMethod; * Controller used to showcase what happens when an exception is thrown * * @author Michael Isvy - *

- * Also see how the bean of type 'SimpleMappingExceptionResolver' has been declared inside - * /WEB-INF/mvc-core-config.xml + *

+ * Also see how a view that resolves to "error" has been added ("error.html"). */ @Controller public class CrashController { @RequestMapping(value = "/oups", method = RequestMethod.GET) public String triggerException() { - throw new RuntimeException("Expected: controller used to showcase what " + - "happens when an exception is thrown"); + throw new RuntimeException( + "Expected: controller used to showcase what " + "happens when an exception is thrown"); } - } diff --git a/src/main/java/org/springframework/samples/petclinic/web/CustomErrorController.java b/src/main/java/org/springframework/samples/petclinic/web/CustomErrorController.java deleted file mode 100644 index 965697c65..000000000 --- a/src/main/java/org/springframework/samples/petclinic/web/CustomErrorController.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.samples.petclinic.web; - -import org.springframework.boot.autoconfigure.web.ErrorController; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class CustomErrorController implements ErrorController { - - @RequestMapping(value = "/error") - public String error() { - return "exception"; - } - - @Override - public String getErrorPath() { - return "/error"; - } -} diff --git a/src/main/java/org/springframework/samples/petclinic/web/VetController.java b/src/main/java/org/springframework/samples/petclinic/web/VetController.java index 54baf395a..5bc343ed6 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/VetController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/VetController.java @@ -18,7 +18,6 @@ package org.springframework.samples.petclinic.web; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; import org.springframework.samples.petclinic.model.Vets; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Controller; @@ -36,32 +35,28 @@ public class VetController { private final ClinicService clinicService; - @Autowired public VetController(ClinicService clinicService) { this.clinicService = clinicService; } - @RequestMapping(value = {"/vets.html"}) + @RequestMapping(value = { "/vets.html" }) public String showVetList(Map model) { - // Here we are returning an object of type 'Vets' rather than a collection of Vet objects - // so it is simpler for Object-Xml mapping + // Here we are returning an object of type 'Vets' rather than a collection of Vet + // objects so it is simpler for Object-Xml mapping Vets vets = new Vets(); vets.getVetList().addAll(this.clinicService.findVets()); model.put("vets", vets); return "vets/vetList"; } - @RequestMapping(value = {"/vets.json", "/vets.xml"}) - public - @ResponseBody - Vets showResourcesVetList() { - // Here we are returning an object of type 'Vets' rather than a collection of Vet objects - // so it is simpler for JSon/Object mapping + @RequestMapping(value = { "/vets.json", "/vets.xml" }) + public @ResponseBody Vets showResourcesVetList() { + // Here we are returning an object of type 'Vets' rather than a collection of Vet + // objects so it is simpler for JSon/Object mapping Vets vets = new Vets(); vets.getVetList().addAll(this.clinicService.findVets()); return vets; } - } diff --git a/src/main/java/org/springframework/samples/petclinic/web/VisitController.java b/src/main/java/org/springframework/samples/petclinic/web/VisitController.java index 144eba2d9..7bd87efa6 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/VisitController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/VisitController.java @@ -89,10 +89,4 @@ public class VisitController { } } - @RequestMapping(value = "/owners/*/pets/{petId}/visits", method = RequestMethod.GET) - public String showVisits(@PathVariable int petId, Map model) { - model.put("visits", this.clinicService.findPetById(petId).getVisits()); - return "visitList"; - } - } diff --git a/src/main/webapp/resources/less/header.less b/src/main/less/header.less similarity index 100% rename from src/main/webapp/resources/less/header.less rename to src/main/less/header.less diff --git a/src/main/webapp/resources/less/petclinic.less b/src/main/less/petclinic.less similarity index 97% rename from src/main/webapp/resources/less/petclinic.less rename to src/main/less/petclinic.less index ebab7e185..7364d2a37 100644 --- a/src/main/webapp/resources/less/petclinic.less +++ b/src/main/less/petclinic.less @@ -11,9 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@import "../generated/META-INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less"; +@import "META-INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less"; -@icon-font-path: "../../webjars/bootstrap/3.3.6/fonts/"; +@icon-font-path: "../../webjars/bootstrap/fonts/"; @spring-green: #6db33f; @spring-dark-green: #5fa134; diff --git a/src/main/webapp/resources/less/responsive.less b/src/main/less/responsive.less similarity index 100% rename from src/main/webapp/resources/less/responsive.less rename to src/main/less/responsive.less diff --git a/src/main/webapp/resources/less/typography.less b/src/main/less/typography.less similarity index 100% rename from src/main/webapp/resources/less/typography.less rename to src/main/less/typography.less diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index db5befadd..c1a7ac2ea 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,8 +4,7 @@ spring.datasource.schema=classpath*:db/${database}/schema.sql spring.datasource.data=classpath*:db/${database}/data.sql # Web -spring.mvc.view.prefix=/WEB-INF/jsp/ -spring.mvc.view.suffix=.jsp +spring.thymeleaf.mode=HTML # JPA spring.jpa.hibernate.ddl-auto=none @@ -18,6 +17,7 @@ management.contextPath=/manage # Logging logging.level.org.springframework=INFO +logging.level.org.springframework.web=DEBUG # Active Spring profiles spring.profiles.active=production diff --git a/src/main/webapp/resources/fonts/montserrat-webfont.eot b/src/main/resources/static/resources/fonts/montserrat-webfont.eot similarity index 100% rename from src/main/webapp/resources/fonts/montserrat-webfont.eot rename to src/main/resources/static/resources/fonts/montserrat-webfont.eot diff --git a/src/main/webapp/resources/fonts/montserrat-webfont.svg b/src/main/resources/static/resources/fonts/montserrat-webfont.svg similarity index 100% rename from src/main/webapp/resources/fonts/montserrat-webfont.svg rename to src/main/resources/static/resources/fonts/montserrat-webfont.svg diff --git a/src/main/webapp/resources/fonts/montserrat-webfont.ttf b/src/main/resources/static/resources/fonts/montserrat-webfont.ttf similarity index 100% rename from src/main/webapp/resources/fonts/montserrat-webfont.ttf rename to src/main/resources/static/resources/fonts/montserrat-webfont.ttf diff --git a/src/main/webapp/resources/fonts/montserrat-webfont.woff b/src/main/resources/static/resources/fonts/montserrat-webfont.woff similarity index 100% rename from src/main/webapp/resources/fonts/montserrat-webfont.woff rename to src/main/resources/static/resources/fonts/montserrat-webfont.woff diff --git a/src/main/webapp/resources/fonts/varela_round-webfont.eot b/src/main/resources/static/resources/fonts/varela_round-webfont.eot similarity index 100% rename from src/main/webapp/resources/fonts/varela_round-webfont.eot rename to src/main/resources/static/resources/fonts/varela_round-webfont.eot diff --git a/src/main/webapp/resources/fonts/varela_round-webfont.svg b/src/main/resources/static/resources/fonts/varela_round-webfont.svg similarity index 100% rename from src/main/webapp/resources/fonts/varela_round-webfont.svg rename to src/main/resources/static/resources/fonts/varela_round-webfont.svg diff --git a/src/main/webapp/resources/fonts/varela_round-webfont.ttf b/src/main/resources/static/resources/fonts/varela_round-webfont.ttf similarity index 100% rename from src/main/webapp/resources/fonts/varela_round-webfont.ttf rename to src/main/resources/static/resources/fonts/varela_round-webfont.ttf diff --git a/src/main/webapp/resources/fonts/varela_round-webfont.woff b/src/main/resources/static/resources/fonts/varela_round-webfont.woff similarity index 100% rename from src/main/webapp/resources/fonts/varela_round-webfont.woff rename to src/main/resources/static/resources/fonts/varela_round-webfont.woff diff --git a/src/main/webapp/resources/images/favicon.png b/src/main/resources/static/resources/images/favicon.png similarity index 100% rename from src/main/webapp/resources/images/favicon.png rename to src/main/resources/static/resources/images/favicon.png diff --git a/src/main/webapp/resources/images/pets.png b/src/main/resources/static/resources/images/pets.png similarity index 100% rename from src/main/webapp/resources/images/pets.png rename to src/main/resources/static/resources/images/pets.png diff --git a/src/main/webapp/resources/images/platform-bg.png b/src/main/resources/static/resources/images/platform-bg.png similarity index 100% rename from src/main/webapp/resources/images/platform-bg.png rename to src/main/resources/static/resources/images/platform-bg.png diff --git a/src/main/webapp/resources/images/spring-logo-dataflow-mobile.png b/src/main/resources/static/resources/images/spring-logo-dataflow-mobile.png similarity index 100% rename from src/main/webapp/resources/images/spring-logo-dataflow-mobile.png rename to src/main/resources/static/resources/images/spring-logo-dataflow-mobile.png diff --git a/src/main/webapp/resources/images/spring-logo-dataflow.png b/src/main/resources/static/resources/images/spring-logo-dataflow.png similarity index 100% rename from src/main/webapp/resources/images/spring-logo-dataflow.png rename to src/main/resources/static/resources/images/spring-logo-dataflow.png diff --git a/src/main/webapp/resources/images/spring-pivotal-logo.png b/src/main/resources/static/resources/images/spring-pivotal-logo.png similarity index 100% rename from src/main/webapp/resources/images/spring-pivotal-logo.png rename to src/main/resources/static/resources/images/spring-pivotal-logo.png diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html new file mode 100644 index 000000000..2b40d7f98 --- /dev/null +++ b/src/main/resources/templates/error.html @@ -0,0 +1,11 @@ + + + + + + +

Something happened...

+

Exception message

+ + + \ No newline at end of file diff --git a/src/main/resources/templates/fragments/inputField.html b/src/main/resources/templates/fragments/inputField.html new file mode 100644 index 000000000..7cef1ee9e --- /dev/null +++ b/src/main/resources/templates/fragments/inputField.html @@ -0,0 +1,26 @@ + + +
+ +
+ +
+ + + + + Error + +
+
+
+
+ + diff --git a/src/main/resources/templates/fragments/layout.html b/src/main/resources/templates/fragments/layout.html new file mode 100644 index 000000000..1ff28614e --- /dev/null +++ b/src/main/resources/templates/fragments/layout.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + PetClinic :: a Spring Framework demonstration + + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+ Sponsored by Pivotal
+
+
+
+
+ + + + + + + + diff --git a/src/main/resources/templates/fragments/selectField.html b/src/main/resources/templates/fragments/selectField.html new file mode 100644 index 000000000..438474463 --- /dev/null +++ b/src/main/resources/templates/fragments/selectField.html @@ -0,0 +1,29 @@ + + +
+ +
+ + +
+ + + + + Error + +
+
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/owners/createOrUpdateOwnerForm.html b/src/main/resources/templates/owners/createOrUpdateOwnerForm.html new file mode 100644 index 000000000..a34a39c7f --- /dev/null +++ b/src/main/resources/templates/owners/createOrUpdateOwnerForm.html @@ -0,0 +1,30 @@ + + + + +

Owner

+
+
+ + + + + +
+
+
+ +
+
+
+ + diff --git a/src/main/resources/templates/owners/findOwners.html b/src/main/resources/templates/owners/findOwners.html new file mode 100644 index 000000000..911ac9581 --- /dev/null +++ b/src/main/resources/templates/owners/findOwners.html @@ -0,0 +1,35 @@ + + + + +

Find Owners

+ +
+
+
+ +
+
+

Error

+
+
+
+
+
+
+ +
+
+ +
+ +
+ Add Owner + + + diff --git a/src/main/resources/templates/owners/ownerDetails.html b/src/main/resources/templates/owners/ownerDetails.html new file mode 100644 index 000000000..746d569be --- /dev/null +++ b/src/main/resources/templates/owners/ownerDetails.html @@ -0,0 +1,83 @@ + + + + + + + +

Owner Information

+ + + + + + + + + + + + + + + + + + + +
Name
Address
City
Telephone
+ + Edit + Owner + Add + New Pet + +
+
+
+

Pets and Visits

+ + + + + + + + +
+
+
Name
+
+
Birth Date
+
+
Type
+
+
+
+ + + + + + + + + + + + + + + +
Visit DateDescription
Edit + PetAdd + Visit
+
+ + + + \ No newline at end of file diff --git a/src/main/resources/templates/owners/ownersList.html b/src/main/resources/templates/owners/ownersList.html new file mode 100644 index 000000000..dc4c44635 --- /dev/null +++ b/src/main/resources/templates/owners/ownersList.html @@ -0,0 +1,33 @@ + + + + + + +

Owners

+ + + + + + + + + + + + + + + + + +
NameAddressCityTelephonePets
+ + + + +
+ + + diff --git a/src/main/resources/templates/pets/createOrUpdatePetForm.html b/src/main/resources/templates/pets/createOrUpdatePetForm.html new file mode 100644 index 000000000..bfa07d1ff --- /dev/null +++ b/src/main/resources/templates/pets/createOrUpdatePetForm.html @@ -0,0 +1,38 @@ + + + + +

+ New + Pet +

+
+ +
+
+ +
+ +
+
+ + + +
+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/resources/templates/pets/createOrUpdateVisitForm.html b/src/main/resources/templates/pets/createOrUpdateVisitForm.html new file mode 100644 index 000000000..c96c3240d --- /dev/null +++ b/src/main/resources/templates/pets/createOrUpdateVisitForm.html @@ -0,0 +1,61 @@ + + + + +

+ New + Visit +

+ + Pet + + + + + + + + + + + + + + + +
NameBirth DateTypeOwner
+ +
+
+ + +
+ +
+
+ + +
+
+
+ +
+ Previous Visits + + + + + + + + + +
DateDescription
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/vets/vetList.html b/src/main/resources/templates/vets/vetList.html new file mode 100644 index 000000000..6d741ee1f --- /dev/null +++ b/src/main/resources/templates/vets/vetList.html @@ -0,0 +1,36 @@ + + + + + + +

Veterinarians

+ + + + + + + + + + + + + + +
NameSpecialties
none
+ + + + + + +
View + as XMLView as JSON
+ + + diff --git a/src/main/resources/templates/welcome.html b/src/main/resources/templates/welcome.html new file mode 100644 index 000000000..6b4ff0480 --- /dev/null +++ b/src/main/resources/templates/welcome.html @@ -0,0 +1,16 @@ + + + + + + +

Welcome

+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jetty-web.xml b/src/main/webapp/WEB-INF/jetty-web.xml deleted file mode 100644 index 5bb92f033..000000000 --- a/src/main/webapp/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - true - diff --git a/src/main/webapp/WEB-INF/jsp/exception.jsp b/src/main/webapp/WEB-INF/jsp/exception.jsp deleted file mode 100644 index d030d595d..000000000 --- a/src/main/webapp/WEB-INF/jsp/exception.jsp +++ /dev/null @@ -1,14 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - - - - - -

Something happened...

- -

${exception.message}

- -
diff --git a/src/main/webapp/WEB-INF/jsp/owners/createOrUpdateOwnerForm.jsp b/src/main/webapp/WEB-INF/jsp/owners/createOrUpdateOwnerForm.jsp deleted file mode 100644 index d7e9e1ab9..000000000 --- a/src/main/webapp/WEB-INF/jsp/owners/createOrUpdateOwnerForm.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - -

- New Owner -

- -
- - - - - -
-
-
- - - - - - - - -
-
-
-
diff --git a/src/main/webapp/WEB-INF/jsp/owners/findOwners.jsp b/src/main/webapp/WEB-INF/jsp/owners/findOwners.jsp deleted file mode 100644 index f9a3e54a2..000000000 --- a/src/main/webapp/WEB-INF/jsp/owners/findOwners.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - - -

Find Owners

- - - -
-
- -
- - -
-
-
-
-
- -
-
- -
- -
- Add Owner -
diff --git a/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp b/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp deleted file mode 100644 index 877e53e8b..000000000 --- a/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp +++ /dev/null @@ -1,98 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - - -

Owner Information

- - - - - - - - - - - - - - - - - - - -
Name
Address
City
Telephone
- - - - - Edit Owner - - - - - Add New Pet - -
-
-
-

Pets and Visits

- - - - - - - - - - -
-
-
Name
-
-
Birth Date
-
-
Type
-
-
-
- - - - - - - - - - - - - - - - - -
Visit DateDescription
- - - - - Edit Pet - - - - - - Add Visit -
-
- -
diff --git a/src/main/webapp/WEB-INF/jsp/owners/ownersList.jsp b/src/main/webapp/WEB-INF/jsp/owners/ownersList.jsp deleted file mode 100644 index 08b1605cf..000000000 --- a/src/main/webapp/WEB-INF/jsp/owners/ownersList.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - -

Owners

- - - - - - - - - - - - - - - - - - - - - - -
NameAddressCityTelephonePets
- - - - - - - - - - - - - - -
-
diff --git a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp deleted file mode 100644 index 8a0b34a30..000000000 --- a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdatePetForm.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - - - - - -

- New Pet -

- - -
-
- -
- -
-
- - -
- -
-
-
-
- - - - - - - - -
-
-
- - -
-
diff --git a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp deleted file mode 100644 index b964e83d4..000000000 --- a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp +++ /dev/null @@ -1,70 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - - - - - - -

New Visit

- - Pet - - - - - - - - - - - - - - - -
NameBirth DateTypeOwner
- - -
- - -
- -
-
- - -
-
-
- -
- Previous Visits - - - - - - - - - - - - - -
DateDescription
-
- -
diff --git a/src/main/webapp/WEB-INF/jsp/vets/vetList.jsp b/src/main/webapp/WEB-INF/jsp/vets/vetList.jsp deleted file mode 100644 index a46434a7f..000000000 --- a/src/main/webapp/WEB-INF/jsp/vets/vetList.jsp +++ /dev/null @@ -1,44 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - -

Veterinarians

- - - - - - - - - - - - - - - - -
NameSpecialties
- - - - - - none -
- - - - - - -
- ">View as XML - - ">View as JSON -
-
diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp deleted file mode 100644 index b801ec67d..000000000 --- a/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ /dev/null @@ -1,14 +0,0 @@ -<%@ page session="false" trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - - -

-
-
- - -
-
-
diff --git a/src/main/webapp/WEB-INF/tags/bodyHeader.tag b/src/main/webapp/WEB-INF/tags/bodyHeader.tag deleted file mode 100644 index cd14d874c..000000000 --- a/src/main/webapp/WEB-INF/tags/bodyHeader.tag +++ /dev/null @@ -1,7 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - -<%@ attribute name="menuName" required="true" rtexprvalue="true" - description="Name of the active menu: home, owners, vets or error" %> - - diff --git a/src/main/webapp/WEB-INF/tags/footer.tag b/src/main/webapp/WEB-INF/tags/footer.tag deleted file mode 100644 index 74179d76f..000000000 --- a/src/main/webapp/WEB-INF/tags/footer.tag +++ /dev/null @@ -1,15 +0,0 @@ -<%@ tag trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - -<%-- Placed at the end of the document so the pages load faster --%> - - - -<%-- jquery-ui.js file is really big so we only load what we need instead of loading everything --%> - - - -<%-- Bootstrap --%> - - - diff --git a/src/main/webapp/WEB-INF/tags/htmlHeader.tag b/src/main/webapp/WEB-INF/tags/htmlHeader.tag deleted file mode 100644 index 323cca463..000000000 --- a/src/main/webapp/WEB-INF/tags/htmlHeader.tag +++ /dev/null @@ -1,34 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - -<%-- -PetClinic :: a Spring Framework demonstration ---%> - - - - - - - <%-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --%> - - - - - PetClinic :: a Spring Framework demonstration - - <%-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --%> - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/tags/inputField.tag b/src/main/webapp/WEB-INF/tags/inputField.tag deleted file mode 100644 index 0db10f39d..000000000 --- a/src/main/webapp/WEB-INF/tags/inputField.tag +++ /dev/null @@ -1,26 +0,0 @@ -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ attribute name="name" required="true" rtexprvalue="true" - description="Name of corresponding property in bean object" %> -<%@ attribute name="label" required="true" rtexprvalue="true" - description="Label appears in red color if input is considered as invalid after submission" %> - - - - -
- - -
- - - - - - - ${status.errorMessage} - -
-
-
diff --git a/src/main/webapp/WEB-INF/tags/layout.tag b/src/main/webapp/WEB-INF/tags/layout.tag deleted file mode 100644 index 870c735b2..000000000 --- a/src/main/webapp/WEB-INF/tags/layout.tag +++ /dev/null @@ -1,27 +0,0 @@ -<%@ tag trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> - -<%@ attribute name="pageName" required="true" %> -<%@ attribute name="customScript" required="false" fragment="true"%> - - - - - - - - -
-
- - - - -
-
- - - - - - diff --git a/src/main/webapp/WEB-INF/tags/menu.tag b/src/main/webapp/WEB-INF/tags/menu.tag deleted file mode 100644 index 6afb0f3f5..000000000 --- a/src/main/webapp/WEB-INF/tags/menu.tag +++ /dev/null @@ -1,45 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %> -<%@ attribute name="name" required="true" rtexprvalue="true" - description="Name of the active menu: home, owners, vets or error" %> - - diff --git a/src/main/webapp/WEB-INF/tags/menuItem.tag b/src/main/webapp/WEB-INF/tags/menuItem.tag deleted file mode 100644 index 8c14dbbc5..000000000 --- a/src/main/webapp/WEB-INF/tags/menuItem.tag +++ /dev/null @@ -1,13 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - -<%@ attribute name="active" required="true" rtexprvalue="true" %> -<%@ attribute name="url" required="true" rtexprvalue="true" %> -<%@ attribute name="title" required="false" rtexprvalue="true" %> - -
  • - " - title="${fn:escapeXml(title)}"> - - -
  • diff --git a/src/main/webapp/WEB-INF/tags/pivotal.tag b/src/main/webapp/WEB-INF/tags/pivotal.tag deleted file mode 100644 index 8ee35fb1f..000000000 --- a/src/main/webapp/WEB-INF/tags/pivotal.tag +++ /dev/null @@ -1,10 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - -
    -
    -
    -
    -
    " - alt="Sponsored by Pivotal"/>
    -
    -
    diff --git a/src/main/webapp/WEB-INF/tags/selectField.tag b/src/main/webapp/WEB-INF/tags/selectField.tag deleted file mode 100644 index 21fad89c3..000000000 --- a/src/main/webapp/WEB-INF/tags/selectField.tag +++ /dev/null @@ -1,30 +0,0 @@ -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ attribute name="name" required="true" rtexprvalue="true" - description="Name of corresponding property in bean object" %> -<%@ attribute name="label" required="true" rtexprvalue="true" - description="Label appears in red color if input is considered as invalid after submission" %> -<%@ attribute name="names" required="true" rtexprvalue="true" type="java.util.List" - description="Names in the list" %> -<%@ attribute name="size" required="true" rtexprvalue="true" - description="Size of Select" %> - - - - -
    - - -
    - - - - - - - ${status.errorMessage} - -
    -
    -
    diff --git a/src/main/webapp/bower_components/bower.json b/src/main/webapp/bower_components/bower.json deleted file mode 100644 index f2d86c7d7..000000000 --- a/src/main/webapp/bower_components/bower.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "spring-petclinic", - "dependencies": {} -} diff --git a/src/main/webapp/resources/.gitignore b/src/main/webapp/resources/.gitignore deleted file mode 100644 index 86d4c2dd3..000000000 --- a/src/main/webapp/resources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -generated diff --git a/src/main/webapp/resources/css/jquery-ui.theme.min.css b/src/main/webapp/resources/css/jquery-ui.theme.min.css deleted file mode 100644 index eff13abdf..000000000 --- a/src/main/webapp/resources/css/jquery-ui.theme.min.css +++ /dev/null @@ -1,11 +0,0 @@ -/* -for further customization, follow the link below -http://jqueryui.com/themeroller/#!zThemeParams=5d00000100d805000000000000003d8888d844329a8dfe02723de3e5700bbb34ecf36cdef1e1654faa0015427bdb9eb45ebe89aaede0ec5f0d92417fcc6551ce804ff46bf543167700d2cf4e583f2515147aacb86ffa11c0e588dae72a13c98dc37478199f7eea536e99702ea72bbd73d5e47a971ce54b81577463f5d94a7dee7b78d730e5f0e5b36143d0854af864d09e6dfeb499c775162a1dc8ece282210987b6ed92e34b030f954391e9a74efd9ae74d5bfa4a0f9279585e59808386e2e2598b131a9fb228b77cdfc6bd5daa135aeb0140333b1fa47281595bd036eaaa5ee8bee7d7645657ab1daf448d27ffc2a4b1a9080e84d697443d6d18d9beb24c48b8832a8969b523e5515db266f031aaeca6b493b2696ad3895cc9feb83467fbe15f1a94aea4c20683fbc63bfa858c2bd17cdfbb5794ae84228f03e7e217d86ec61bf878d21e0b59eecbb9f78e49015d1a1c954de1a4792b7a85c60d93fced492ed82ede7ae3041401aec984aecdea1eb7c567893d71a08abc1c2773489cceaf48ba1827b3cbee4a0473234c78c93160129fe9f83c16a6eef336ff92590214e03c56c9f6fa21323586d93d7c681556b7225c4251843df88826359ebe2dac6a418562470edb1e58a67d3876d984fddba1ef -remember to update the link when you changed the theme -*/ - -/*! jQuery UI - v1.11.4 - 2016-06-28 -* http://jqueryui.com -* Copyright jQuery Foundation and other contributors; Licensed MIT */ - -.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#6db33f;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#2b2b2b;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #5fa134;background:#6db33f;font-weight:normal;color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #6db33f;background:#88D041;color:#fff}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#fff}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:0 0 0 0;padding:5px;background:#666;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} diff --git a/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java b/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java index 8a1934ce1..237f0f47b 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java @@ -65,13 +65,4 @@ public class VisitControllerTests { .andExpect(view().name("pets/createOrUpdateVisitForm")); } - @Test - public void testShowVisits() throws Exception { - mockMvc.perform(get("/owners/*/pets/{petId}/visits", TEST_PET_ID)) - .andExpect(status().isOk()) - .andExpect(model().attributeExists("visits")) - .andExpect(view().name("visitList")); - } - - }