From e38a9feebe1814ada460dea50ba45f11389fdc9f Mon Sep 17 00:00:00 2001 From: Dave Syer <dsyer@pivotal.io> Date: Thu, 10 Nov 2016 16:51:14 +0000 Subject: [PATCH] Convert to jar with thymeleaf --- pom.xml | 564 ++++++++---------- 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, 766 insertions(+), 1064 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 1b6a5ed..e0477cb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,340 +1,264 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.springframework.samples</groupId> - <artifactId>springboot-petclinic</artifactId> - <version>1.4.1</version> - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>1.4.1.RELEASE</version> - </parent> - <name>petclinic</name> - <packaging>war</packaging> - - <properties> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.springframework.samples</groupId> + <artifactId>springboot-petclinic</artifactId> + <version>1.4.1</version> - <!-- Generic properties --> - <java.version>1.7</java.version> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <docker.image.prefix>arey</docker.image.prefix> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>1.4.1.RELEASE</version> + </parent> + <name>petclinic</name> - <!-- Web dependencies --> - <webjars-bootstrap.version>3.3.6</webjars-bootstrap.version> - <webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version> - <webjars-jquery.version>2.2.4</webjars-jquery.version> + <properties> - <cobertura.version>2.7</cobertura.version> + <!-- Generic properties --> + <java.version>1.8</java.version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - </properties> + <!-- Web dependencies --> + <webjars-bootstrap.version>3.3.6</webjars-bootstrap.version> + <webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version> + <webjars-jquery.version>2.2.4</webjars-jquery.version> - <dependencies> - <!-- Spring et Spring Boot dependencies --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-actuator</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-cache</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <!-- Uncomment bellow lines in order to deploy the Springboot Petlinic WAR file into an external Jetty --> - <!--exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - </exclusion> - </exclusions--> - </dependency> + <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version> + <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-jasper</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - </dependency> + <cobertura.version>2.7</cobertura.version> - <!-- Databases - Uses HSQL by default --> - <dependency> - <groupId>org.hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <scope>runtime</scope> - </dependency> + </properties> - <!-- For MySql only --> - <!--dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>${mysql-driver.version}</version> - </dependency--> + <dependencies> + <!-- Spring and Spring Boot dependencies --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-cache</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jpa</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-thymeleaf</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> - <!-- EhCache --> - <dependency> - <groupId>javax.cache</groupId> - <artifactId>cache-api</artifactId> - </dependency> - <dependency> - <groupId>org.ehcache</groupId> - <artifactId>ehcache</artifactId> - </dependency> + <!-- Databases - Uses HSQL by default --> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <scope>runtime</scope> + </dependency> - <!-- webjars --> - <dependency> - <groupId>org.webjars</groupId> - <artifactId>jquery</artifactId> - <version>${webjars-jquery.version}</version> - </dependency> - <dependency> - <groupId>org.webjars</groupId> - <artifactId>jquery-ui</artifactId> - <version>${webjars-jquery-ui.version}</version> - </dependency> - <dependency> - <groupId>org.webjars</groupId> - <artifactId>bootstrap</artifactId> - <version>${webjars-bootstrap.version}</version> - </dependency> - <!-- end of webjars --> + <!-- EhCache --> + <dependency> + <groupId>javax.cache</groupId> + <artifactId>cache-api</artifactId> + </dependency> + <dependency> + <groupId>org.ehcache</groupId> + <artifactId>ehcache</artifactId> + </dependency> - </dependencies> + <!-- webjars --> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>webjars-locator</artifactId> + </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>jquery</artifactId> + <version>${webjars-jquery.version}</version> + </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>jquery-ui</artifactId> + <version>${webjars-jquery-ui.version}</version> + </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>bootstrap</artifactId> + <version>${webjars-bootstrap.version}</version> + </dependency> + <!-- end of webjars --> - <!-- Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term --> - <build> - <finalName>petclinic</finalName> - <defaultGoal>install</defaultGoal> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present --> - <goals> - <goal>build-info</goal> - </goals> - <configuration> - <additionalProperties> - <encoding.source>${project.build.sourceEncoding}</encoding.source> - <encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting> - <java.source>${maven.compiler.source}</java.source> - <java.target>${maven.compiler.target}</java.target> - </additionalProperties> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.0</version> - <configuration> - <compilerArguments> - <Xlint/> - </compilerArguments> - <verbose>true</verbose> - <source>${java.version}</source> - <target>${java.version}</target> - <showWarnings>true</showWarnings> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.13</version> - <configuration> - <includes> - <include>**/*Tests.java</include> - </includes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.9</version> - <configuration> - <downloadSources>true</downloadSources> - <downloadJavadocs>true</downloadJavadocs> - <wtpversion>2.0</wtpversion> - <sourceIncludes> - <sourceInclude>**/*.*</sourceInclude> - </sourceIncludes> - <additionalBuildcommands> - <buildCommand> - <name>org.springframework.ide.eclipse.core.springbuilder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.m2e.core.maven2Builder</name> - </buildCommand> - </additionalBuildcommands> - <additionalProjectnatures> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> - <projectnature>org.eclipse.m2e.core.maven2Nature</projectnature> - </additionalProjectnatures> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>${cobertura.version}</version> - <configuration> - <check/> - </configuration> - <executions> - <execution> - <goals> - <goal>clean</goal> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> - <!-- Spring Boot Actuator displays build-related information if a git.properties file is present at the classpath --> - <plugin> - <groupId>pl.project13.maven</groupId> - <artifactId>git-commit-id-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>revision</goal> - </goals> - </execution> - </executions> - <configuration> - <verbose>true</verbose> - <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat> - <generateGitPropertiesFile>true</generateGitPropertiesFile> - <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties - </generateGitPropertiesFilename> - </configuration> - </plugin> - - <plugin> - <!-- - right now lesscss maven plugin does NOT support @Import from classpath - https://github.com/marceloverdijk/lesscss-maven-plugin/issues/72 + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <!-- Spring Boot Actuator displays build-related information + if a META-INF/build-info.properties file is present --> + <goals> + <goal>build-info</goal> + </goals> + <configuration> + <additionalProperties> + <encoding.source>${project.build.sourceEncoding}</encoding.source> + <encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting> + <java.source>${maven.compiler.source}</java.source> + <java.target>${maven.compiler.target}</java.target> + </additionalProperties> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>${cobertura.version}</version> + <configuration> + <check /> + </configuration> + <executions> + <execution> + <goals> + <goal>clean</goal> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> - workaround here will be unpacking the bootstrap on-the-fly + <!-- Spring Boot Actuator displays build-related information if a git.properties + file is present at the classpath --> + <plugin> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>revision</goal> + </goals> + </execution> + </executions> + <configuration> + <verbose>true</verbose> + <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat> + <generateGitPropertiesFile>true</generateGitPropertiesFile> + <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties + </generateGitPropertiesFilename> + </configuration> + </plugin> - remove this plugin config when the issue is resolved OR a better resolution is found - --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>unpack</id> - <phase>process-resources</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.webjars</groupId> - <artifactId>bootstrap</artifactId> - <version>3.3.6</version> - <overWrite>false</overWrite> - <outputDirectory>${project.basedir}/src/main/webapp/resources/generated - </outputDirectory> - <includes>**/*.less</includes> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> + <plugin> + <!-- right now lesscss maven plugin does NOT support @Import from + classpath https://github.com/marceloverdijk/lesscss-maven-plugin/issues/72 + workaround here will be unpacking the bootstrap on-the-fly remove this plugin + config when the issue is resolved OR a better resolution is found --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>process-resources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.webjars</groupId> + <artifactId>bootstrap</artifactId> + <version>${webjars-bootstrap.version}</version> + <overWrite>false</overWrite> + <outputDirectory>${project.basedir}/target/less + </outputDirectory> + <includes>**/*.less</includes> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> - <plugin> - <!-- refer to dependency plugin comments above --> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>${project.basedir}/src/main/webapp/resources/generated</directory> - </fileset> - </filesets> - </configuration> - </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <phase>validate</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/less</outputDirectory> + <resources> + <resource> + <directory>src/main/less</directory> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> - <plugin> - <groupId>org.lesscss</groupId> - <artifactId>lesscss-maven-plugin</artifactId> - <version>1.7.0.1.1</version> - <configuration> - <sourceDirectory>${project.basedir}/src/main/webapp/resources/less</sourceDirectory> - <outputDirectory>${project.basedir}/src/main/webapp/resources/generated</outputDirectory> - <compress>true</compress> - <includes> - <include>petclinic.less</include> - </includes> - </configuration> - <executions> - <execution> - <phase>process-resources</phase> - <goals> - <goal>compile</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>com.spotify</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>0.4.11</version> - <configuration> - <imageName>${docker.image.prefix}/${project.artifactId}</imageName> - <dockerDirectory>src/main/docker</dockerDirectory> - <resources> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>${project.build.finalName}.war</include> - </resource> - </resources> - <forceTags>true</forceTags> - <imageTags> - <imageTag>${project.version}</imageTag> - <imageTag>latest</imageTag> - </imageTags> - <useConfigFile>true</useConfigFile> - </configuration> - </plugin> - </plugins> - </build> - <reporting> - <plugins> - <!-- integrate maven-cobertura-plugin to project site --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>${cobertura.version}</version> - <configuration> - <formats> - <format>html</format> - </formats> - <check/> - </configuration> - </plugin> - </plugins> - </reporting> + <plugin> + <groupId>org.lesscss</groupId> + <artifactId>lesscss-maven-plugin</artifactId> + <version>1.7.0.1.1</version> + <configuration> + <sourceDirectory>${project.build.directory}/less</sourceDirectory> + <outputDirectory>${project.build.directory}/classes/static/resources/css</outputDirectory> + <compress>true</compress> + <includes> + <include>petclinic.less</include> + </includes> + </configuration> + <executions> + <execution> + <phase>process-resources</phase> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + <!-- integrate maven-cobertura-plugin to project site --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>${cobertura.version}</version> + <configuration> + <formats> + <format>html</format> + </formats> + <check /> + </configuration> + </plugin> + </plugins> + </reporting> - <url>demopetclinic</url> </project> diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile deleted file mode 100644 index cbbf162..0000000 --- a/src/main/docker/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM openjdk:alpine -MAINTAINER Antoine Rey <antoine.rey@free.fr> -# 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 456b061..80859de 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 205d529..d21db69 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<Visit> visits; + private Set<Visit> 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 841d0bc..4b0a0ad 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<Owner, Integer> { * @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 58e73d7..2ddea85 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<Pet, Integer> { * @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 f5ccbed..5c2e47a 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<Visit> findVisitsByPetId(int petId) { - return visitRepository.findByPetId(petId); - } - + @Override + public Collection<Visit> 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 29c55c1..303707b 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 - * <p/> - * Also see how the bean of type 'SimpleMappingExceptionResolver' has been declared inside - * /WEB-INF/mvc-core-config.xml + * <p/> + * 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 965697c..0000000 --- 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 54baf39..5bc343e 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<String, Object> 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 144eba2..7bd87ef 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<String, Object> 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 ebab7e1..7364d2a 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 db5befa..c1a7ac2 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 0000000..2b40d7f --- /dev/null +++ b/src/main/resources/templates/error.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> + +<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'error')}"> + + <body> + <img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/> + <h2>Something happened...</h2> + <p th:text="${message}">Exception message</p> + </body> + +</html> \ 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 0000000..7cef1ee --- /dev/null +++ b/src/main/resources/templates/fragments/inputField.html @@ -0,0 +1,26 @@ +<html> +<body> + <form> + <th:block th:fragment="input (label, name)"> + <div th:with="valid=${!#fields.hasErrors(name)}" + th:class="${'form-group' + (valid ? '' : ' has-error')}" + class="form-group"> + <label class="col-sm-2 control-label" th:text="${label}">Label</label> + <div class="col-sm-10"> + <input class="form-control" type="text" + th:field="*{__${name}__}" /> + <span th:if="${valid}" + class="glyphicon glyphicon-ok form-control-feedback" + aria-hidden="true"></span> + <th:block th:if="${!valid}"> + <span + class="glyphicon glyphicon-remove form-control-feedback" + aria-hidden="true"></span> + <span class="help-inline" th:errors="*{__${name}__}">Error</span> + </th:block> + </div> + </div> + </th:block> + </form> +</body> +</html> diff --git a/src/main/resources/templates/fragments/layout.html b/src/main/resources/templates/fragments/layout.html new file mode 100644 index 0000000..1ff2861 --- /dev/null +++ b/src/main/resources/templates/fragments/layout.html @@ -0,0 +1,94 @@ +<!doctype html> +<html th:fragment="layout (template, menu)"> + + <head> + + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <link rel="shortcut icon" type="image/x-icon" th:href="@{/resources/images/favicon.png}"> + + <title>PetClinic :: a Spring Framework demonstration</title> + + <!--[if lt IE 9]> + <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> + <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> + <![endif]--> + + <link rel="stylesheet" th:href="@{/resources/css/petclinic.css}"/> + + </head> + +<body> + + <nav class="navbar navbar-default" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <a class="navbar-brand" th:href="@{/}"><span></span></a> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar"> + <span class="sr-only"><os-p>Toggle navigation</os-p></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + <div class="navbar-collapse collapse" id="main-navbar"> + <ul class="nav navbar-nav navbar-right"> + + <li th:fragment="menuItem (path,active,title,glyph,text)" class="active" th:class="${active==menu ? 'active' : ''}"> + <a th:href="@{__${path}__}" th:title="${title}"> + <span th:class="'glyphicon glyphicon-'+${glyph}" class="glyphicon glyphicon-home" aria-hidden="true"></span> + <span th:text="${text}">Template</span> + </a> + </li> + + <li th:replace="::menuItem ('/','home','home page','home','Home')"> + <span class="glyphicon glyphicon-home" aria-hidden="true"></span> + <span>Home</span> + </li> + + <li th:replace="::menuItem ('/owners/find','owners','find owners','search','Find owners')"> + <span class="glyphicon glyphicon-search" aria-hidden="true"></span> + <span>Find owners</span> + </li> + + <li th:replace="::menuItem ('/vets.html','vets','veterinarians','th-list','Veterinarians')"> + <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> + <span>Veterinarians</span> + </li> + + <li th:replace="::menuItem ('/oups','error','trigger a RuntimeException to see how it is handled','th-warning-sign','Error')"> + <span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span> + <span>Error</span> + </li> + + </ul> + </div> + </div> + </nav> + <div class="container-fluid"> + <div class="container xd-container"> + + <div th:replace="${template}"/> + + <br/> + <br/> + <div class="container"> + <div class="row"> + <div class="col-12 text-center"> + <img src="../static/resources/images/spring-pivotal-logo.png" th:src="@{/resources/images/spring-pivotal-logo.png}" + alt="Sponsored by Pivotal"/></div> + </div> + </div> + </div> + </div> + + <script th:src="@{/webjars/jquery/jquery.min.js}"></script> + <script th:src="@{/webjars/jquery-ui/jquery-ui.min.js}"></script> + <script th:src="@{/webjars/bootstrap/js/bootstrap.min.js}"></script> + +</body> + +</html> diff --git a/src/main/resources/templates/fragments/selectField.html b/src/main/resources/templates/fragments/selectField.html new file mode 100644 index 0000000..4384744 --- /dev/null +++ b/src/main/resources/templates/fragments/selectField.html @@ -0,0 +1,29 @@ +<html> +<body> + <form> + <th:block th:fragment="select (label, name, items)"> + <div th:with="valid=${!#fields.hasErrors(name)}" + th:class="${'form-group' + (valid ? '' : ' has-error')}" + class="form-group"> + <label class="col-sm-2 control-label" th:text="${label}">Label</label> + + <div class="col-sm-10"> + <select th:field="*{__${name}__}"> + <option th:each="item : ${items}" th:value="${item}" + th:text="${item}">dog</option> + </select> + <span th:if="${valid}" + class="glyphicon glyphicon-ok form-control-feedback" + aria-hidden="true"></span> + <th:block th:if="${!valid}"> + <span + class="glyphicon glyphicon-remove form-control-feedback" + aria-hidden="true"></span> + <span class="help-inline" th:errors="*{__${name}__}">Error</span> + </th:block> + </div> + </div> + </th:block> + </form> +</body> +</html> \ 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 0000000..a34a39c --- /dev/null +++ b/src/main/resources/templates/owners/createOrUpdateOwnerForm.html @@ -0,0 +1,30 @@ +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + +<body> + + <h2>Owner</h2> + <form th:object="${owner}" class="form-horizontal" id="add-owner-form" method="post"> + <div class="form-group has-feedback"> + <input + th:replace="~{fragments/inputField :: input ('First Name', 'firstName')}" /> + <input + th:replace="~{fragments/inputField :: input ('Last Name', 'lastName')}" /> + <input + th:replace="~{fragments/inputField :: input ('Address', 'address')}" /> + <input + th:replace="~{fragments/inputField :: input ('City', 'city')}" /> + <input + th:replace="~{fragments/inputField :: input ('Telephone', 'telephone')}" /> + </div> + <div class="form-group"> + <div class="col-sm-offset-2 col-sm-10"> + <button + th:with="text=${owner['new']} ? 'Add Owner' : 'Update Owner'" + class="btn btn-default" type="submit" th:text="${text}">Add + Owner</button> + </div> + </div> + </form> +</body> +</html> diff --git a/src/main/resources/templates/owners/findOwners.html b/src/main/resources/templates/owners/findOwners.html new file mode 100644 index 0000000..911ac95 --- /dev/null +++ b/src/main/resources/templates/owners/findOwners.html @@ -0,0 +1,35 @@ +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + +<body> + + <h2>Find Owners</h2> + + <form th:object="${owner}" th:action="@{/owners}" method="get" + class="form-horizontal" id="search-owner-form"> + <div class="form-group"> + <div class="control-group" id="lastName"> + <label class="col-sm-2 control-label">Last name </label> + <div class="col-sm-10"> + <input class="form-control" th:field="*{lastName}" size="30" + maxlength="80" /> <span class="help-inline"><div + th:if="${#fields.hasAnyErrors()}"> + <p th:each="err : ${#fields.allErrors()}" th:text="${err}">Error</p> + </div></span> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-offset-2 col-sm-10"> + <button type="submit" class="btn btn-default">Find + Owner</button> + </div> + </div> + + </form> + + <br /> + <a class="btn btn-default" th:href="@{/owners/new}">Add Owner</a> + +</body> +</html> diff --git a/src/main/resources/templates/owners/ownerDetails.html b/src/main/resources/templates/owners/ownerDetails.html new file mode 100644 index 0000000..746d569 --- /dev/null +++ b/src/main/resources/templates/owners/ownerDetails.html @@ -0,0 +1,83 @@ +<!DOCTYPE html> + +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + + <body> + + + <h2>Owner Information</h2> + + + <table class="table table-striped" th:object="${owner}"> + <tr> + <th>Name</th> + <td><b th:text="*{firstName + ' ' + lastName}"></b></td> + </tr> + <tr> + <th>Address</th> + <td th:text="*{address}" /></td> + </tr> + <tr> + <th>City</th> + <td th:text="*{city}" /></td> + </tr> + <tr> + <th>Telephone</th> + <td th:text="*{telephone}" /></td> + </tr> + </table> + + <a th:href="@{{id}/edit(id=${owner.id})}" class="btn btn-default">Edit + Owner</a> + <a th:href="@{{id}/pets/new(id=${owner.id})}" class="btn btn-default">Add + New Pet</a> + + <br /> + <br /> + <br /> + <h2>Pets and Visits</h2> + + <table class="table table-striped"> + + <tr th:each="pet : ${owner.pets}"> + <td valign="top"> + <dl class="dl-horizontal"> + <dt>Name</dt> + <dd th:text="${pet.name}" /></dd> + <dt>Birth Date</dt> + <dd + th:text="${#calendars.format(pet.birthDate, 'yyyy-MM-dd')}" /></dd> + <dt>Type</dt> + <dd th:text="${pet.type}" /></dd> + </dl> + </td> + <td valign="top"> + <table class="table-condensed"> + <thead> + <tr> + <th>Visit Date</th> + <th>Description</th> + </tr> + </thead> + <tr th:each="visit : ${pet.visits}"> + <td th:text="${#calendars.format(visit.date, 'yyyy-MM-dd')}"></td> + <td th:text="${visit?.description}"></td> + </tr> + <tr> + <td><a + th:href="@{{ownerId}/pets/{petId}/edit(ownerId=${owner.id},petId=${pet.id})}">Edit + Pet</a></td> + <td><a + th:href="@{{ownerId}/pets/{petId}/visits/new(ownerId=${owner.id},petId=${pet.id})}">Add + Visit</a></td> + </tr> + </table> + </td> + </tr> + + </table> + + </body> + +</html> \ 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 0000000..dc4c446 --- /dev/null +++ b/src/main/resources/templates/owners/ownersList.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> + +<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + + <body> + + <h2>Owners</h2> + + <table id="vets" class="table table-striped"> + <thead> + <tr> + <th style="width: 150px;">Name</th> + <th style="width: 200px;">Address</th> + <th>City</th> + <th style="width: 120px">Telephone</th> + <th>Pets</th> + </tr> + </thead> + <tbody> + <tr th:each="owner : ${selections}"> + <td> + <a th:href="@{owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"/></a> + </td> + <td th:text="${owner.address}"/> + <td th:text="${owner.city}"/> + <td th:text="${owner.telephone}"/> + <td><span th:each="pet : ${owner.pets}" th:text="${pet.name} "/></td> + </tr> + </tbody> + </table> + + </body> +</html> diff --git a/src/main/resources/templates/pets/createOrUpdatePetForm.html b/src/main/resources/templates/pets/createOrUpdatePetForm.html new file mode 100644 index 0000000..bfa07d1 --- /dev/null +++ b/src/main/resources/templates/pets/createOrUpdatePetForm.html @@ -0,0 +1,38 @@ +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + +<body> + + <h2> + <th:block th:if="${pet['new']}">New </th:block> + Pet + </h2> + <form th:object="${pet}" class="form-horizontal" method="post"> + <input type="hidden" name="id" th:value="*{id}" /> + <div class="form-group has-feedback"> + <div class="form-group"> + <label class="col-sm-2 control-label">Owner</label> + <div class="col-sm-10"> + <span th:text="${pet.owner?.firstName + ' ' + pet.owner?.lastName}" /> + </div> + </div> + <input + th:replace="~{fragments/inputField :: input ('Name', 'name')}" /> + <input + th:replace="~{fragments/inputField :: input ('Birth Date', 'birthDate')}" /> + <input + th:replace="~{fragments/selectField :: select ('Type', 'type', ${types})}" /> + </div> + <div class="form-group"> + <div class="col-sm-offset-2 col-sm-10"> + <button + th:with="text=${owner['new']} ? 'Add Pet' : 'Update Pet'" + class="btn btn-default" type="submit" th:text="${text}">Add + Pet</button> + </div> + </div> + </form> + +</body> + +</html> \ 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 0000000..c96c324 --- /dev/null +++ b/src/main/resources/templates/pets/createOrUpdateVisitForm.html @@ -0,0 +1,61 @@ +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'owners')}"> + +<body> + + <h2> + <th:block th:if="${visit['new']}">New </th:block> + Visit + </h2> + + <b>Pet</b> + <table class="table table-striped"> + <thead> + <tr> + <th>Name</th> + <th>Birth Date</th> + <th>Type</th> + <th>Owner</th> + </tr> + </thead> + <tr> + <td th:text="${visit.pet.name}" /></td> + <td + th:text="${#calendars.format(visit.pet.birthDate, 'yyyy-MM-dd')}" /></td> + <td th:text="${visit.pet.type}" /></td> + <td + th:text="${visit.pet.owner?.firstName + ' ' + visit.pet.owner?.lastName}" /></td> + </tr> + </table> + + <form th:object="${visit}" class="form-horizontal" method="post"> + <div class="form-group has-feedback"> + <input + th:replace="~{fragments/inputField :: input ('Date', 'date')}" /> + <input + th:replace="~{fragments/inputField :: input ('Description', 'description')}" /> + </div> + + <div class="form-group"> + <div class="col-sm-offset-2 col-sm-10"> + <input type="hidden" name="petId" th:value="${visit.pet.id}" /> + <button class="btn btn-default" type="submit">Add Visit</button> + </div> + </div> + </form> + + <br /> + <b>Previous Visits</b> + <table class="table table-striped"> + <tr> + <th>Date</th> + <th>Description</th> + </tr> + <tr th:if="${!visit['new']}" th:each="visit : ${visit.pet.visits}"> + <td th:text="${#calendars.format(visit.date, 'yyyy-MM-dd')}" /></td> + <td th:text=" ${visit.description}" /></td> + </tr> + </table> + +</body> +</html> \ 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 0000000..6d741ee --- /dev/null +++ b/src/main/resources/templates/vets/vetList.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> + +<html xmlns:th="http://www.thymeleaf.org" + th:replace="~{fragments/layout :: layout (~{::body},'vets')}"> + +<body> + + <h2>Veterinarians</h2> + + <table id="vets" class="table table-striped"> + <thead> + <tr> + <th>Name</th> + <th>Specialties</th> + </tr> + </thead> + <tbody> + <tr th:each="vet : ${vets.vetList}"> + <td th:text="${vet.firstName + ' ' + vet.lastName}"></td> + <td><span th:each="specialty : ${vet.specialties}" + th:text="${specialty.name + ' '}" /> <span + th:if="${vet.nrOfSpecialties == 0}">none</span></td> + </tr> + </tbody> + </table> + + <table class="table-buttons"> + <tr> + <td><a th:href="@{/vets.html}">View + as XML</a></td> + <td><a th:href="@{/vets.json}">View as JSON</a></td> + </tr> + </table> + +</body> +</html> diff --git a/src/main/resources/templates/welcome.html b/src/main/resources/templates/welcome.html new file mode 100644 index 0000000..6b4ff04 --- /dev/null +++ b/src/main/resources/templates/welcome.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> + +<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}"> + + <body> + + <h2 th:text="#{welcome}">Welcome</h2> + <div class="row"> + <div class="col-md-12"> + <img class="img-responsive" src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/> + </div> + </div> + + </body> + +</html> \ 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 5bb92f0..0000000 --- a/src/main/webapp/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> -<Configure class="org.eclipse.jetty.webapp.WebAppContext"> - <!-- Fix Jetty 9 issue --> - <!-- http://stackoverflow.com/questions/32643530/classpath-issue-between-jetty-maven-plugin-and-tomcat-jdbc-8-0-9-leading-to-ser --> - <Set name="parentLoaderPriority">true</Set> -</Configure> 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 d030d59..0000000 --- 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" %> - -<petclinic:layout pageName="error"> - - <spring:url value="/resources/images/pets.png" var="petsImage"/> - <img src="${petsImage}"/> - - <h2>Something happened...</h2> - - <p>${exception.message}</p> - -</petclinic:layout> 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 d7e9e1a..0000000 --- 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" %> - -<petclinic:layout pageName="owners"> - <h2> - <c:if test="${owner['new']}">New </c:if> Owner - </h2> - <form:form modelAttribute="owner" class="form-horizontal" id="add-owner-form"> - <div class="form-group has-feedback"> - <petclinic:inputField label="First Name" name="firstName"/> - <petclinic:inputField label="Last Name" name="lastName"/> - <petclinic:inputField label="Address" name="address"/> - <petclinic:inputField label="City" name="city"/> - <petclinic:inputField label="Telephone" name="telephone"/> - </div> - <div class="form-group"> - <div class="col-sm-offset-2 col-sm-10"> - <c:choose> - <c:when test="${owner['new']}"> - <button class="btn btn-default" type="submit">Add Owner</button> - </c:when> - <c:otherwise> - <button class="btn btn-default" type="submit">Update Owner</button> - </c:otherwise> - </c:choose> - </div> - </div> - </form:form> -</petclinic:layout> 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 f9a3e54..0000000 --- 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" %> - -<petclinic:layout pageName="owners"> - - <h2>Find Owners</h2> - - <spring:url value="/owners.html" var="formUrl"/> - <form:form modelAttribute="owner" action="${fn:escapeXml(formUrl)}" method="get" class="form-horizontal" - id="search-owner-form"> - <div class="form-group"> - <div class="control-group" id="lastName"> - <label class="col-sm-2 control-label">Last name </label> - <div class="col-sm-10"> - <form:input class="form-control" path="lastName" size="30" maxlength="80"/> - <span class="help-inline"><form:errors path="*"/></span> - </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-offset-2 col-sm-10"> - <button type="submit" class="btn btn-default">Find Owner</button> - </div> - </div> - - </form:form> - - <br/> - <a class="btn btn-default" href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a> -</petclinic:layout> 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 877e53e..0000000 --- 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" %> - -<petclinic:layout pageName="owners"> - - <h2>Owner Information</h2> - - - <table class="table table-striped"> - <tr> - <th>Name</th> - <td><b><c:out value="${owner.firstName} ${owner.lastName}"/></b></td> - </tr> - <tr> - <th>Address</th> - <td><c:out value="${owner.address}"/></td> - </tr> - <tr> - <th>City</th> - <td><c:out value="${owner.city}"/></td> - </tr> - <tr> - <th>Telephone</th> - <td><c:out value="${owner.telephone}"/></td> - </tr> - </table> - - <spring:url value="{ownerId}/edit.html" var="editUrl"> - <spring:param name="ownerId" value="${owner.id}"/> - </spring:url> - <a href="${fn:escapeXml(editUrl)}" class="btn btn-default">Edit Owner</a> - - <spring:url value="{ownerId}/pets/new.html" var="addUrl"> - <spring:param name="ownerId" value="${owner.id}"/> - </spring:url> - <a href="${fn:escapeXml(addUrl)}" class="btn btn-default">Add New Pet</a> - - <br/> - <br/> - <br/> - <h2>Pets and Visits</h2> - - <table class="table table-striped"> - <c:forEach var="pet" items="${owner.pets}"> - - <tr> - <td valign="top"> - <dl class="dl-horizontal"> - <dt>Name</dt> - <dd><c:out value="${pet.name}"/></dd> - <dt>Birth Date</dt> - <dd><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></dd> - <dt>Type</dt> - <dd><c:out value="${pet.type.name}"/></dd> - </dl> - </td> - <td valign="top"> - <table class="table-condensed"> - <thead> - <tr> - <th>Visit Date</th> - <th>Description</th> - </tr> - </thead> - <c:forEach var="visit" items="${pet.visits}"> - <tr> - <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td> - <td><c:out value="${visit.description}"/></td> - </tr> - </c:forEach> - <tr> - <td> - <spring:url value="/owners/{ownerId}/pets/{petId}/edit" var="petUrl"> - <spring:param name="ownerId" value="${owner.id}"/> - <spring:param name="petId" value="${pet.id}"/> - </spring:url> - <a href="${fn:escapeXml(petUrl)}">Edit Pet</a> - </td> - <td> - <spring:url value="/owners/{ownerId}/pets/{petId}/visits/new" var="visitUrl"> - <spring:param name="ownerId" value="${owner.id}"/> - <spring:param name="petId" value="${pet.id}"/> - </spring:url> - <a href="${fn:escapeXml(visitUrl)}">Add Visit</a> - </td> - </tr> - </table> - </td> - </tr> - - </c:forEach> - </table> - -</petclinic:layout> 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 08b1605..0000000 --- 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" %> - -<petclinic:layout pageName="owners"> - <h2>Owners</h2> - - <table id="vets" class="table table-striped"> - <thead> - <tr> - <th style="width: 150px;">Name</th> - <th style="width: 200px;">Address</th> - <th>City</th> - <th style="width: 120px">Telephone</th> - <th>Pets</th> - </tr> - </thead> - <tbody> - <c:forEach items="${selections}" var="owner"> - <tr> - <td> - <spring:url value="/owners/{ownerId}.html" var="ownerUrl"> - <spring:param name="ownerId" value="${owner.id}"/> - </spring:url> - <a href="${fn:escapeXml(ownerUrl)}"><c:out value="${owner.firstName} ${owner.lastName}"/></a> - </td> - <td> - <c:out value="${owner.address}"/> - </td> - <td> - <c:out value="${owner.city}"/> - </td> - <td> - <c:out value="${owner.telephone}"/> - </td> - <td> - <c:forEach var="pet" items="${owner.pets}"> - <c:out value="${pet.name} "/> - </c:forEach> - </td> - </tr> - </c:forEach> - </tbody> - </table> -</petclinic:layout> 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 8a0b34a..0000000 --- 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" %> - -<petclinic:layout pageName="owners"> - <jsp:attribute name="customScript"> - <script> - $(function () { - $("#birthDate").datepicker({dateFormat: 'yy/mm/dd'}); - }); - </script> - </jsp:attribute> - <jsp:body> - <h2> - <c:if test="${pet['new']}">New </c:if> Pet - </h2> - <form:form modelAttribute="pet" - class="form-horizontal"> - <input type="hidden" name="id" value="${pet.id}"/> - <div class="form-group has-feedback"> - <div class="form-group"> - <label class="col-sm-2 control-label">Owner</label> - <div class="col-sm-10"> - <c:out value="${pet.owner.firstName} ${pet.owner.lastName}"/> - </div> - </div> - <petclinic:inputField label="Name" name="name"/> - <petclinic:inputField label="Birth Date" name="birthDate"/> - <div class="control-group"> - <petclinic:selectField name="type" label="Type " names="${types}" size="5"/> - </div> - </div> - <div class="form-group"> - <div class="col-sm-offset-2 col-sm-10"> - <c:choose> - <c:when test="${pet['new']}"> - <button class="btn btn-default" type="submit">Add Pet</button> - </c:when> - <c:otherwise> - <button class="btn btn-default" type="submit">Update Pet</button> - </c:otherwise> - </c:choose> - </div> - </div> - </form:form> - <c:if test="${!pet['new']}"> - </c:if> - </jsp:body> -</petclinic:layout> 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 b964e83..0000000 --- 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" %> - - -<petclinic:layout pageName="owners"> - <jsp:attribute name="customScript"> - <script> - $(function () { - $("#date").datepicker({dateFormat: 'yy/mm/dd'}); - }); - </script> - </jsp:attribute> - <jsp:body> - <h2><c:if test="${visit['new']}">New </c:if>Visit</h2> - - <b>Pet</b> - <table class="table table-striped"> - <thead> - <tr> - <th>Name</th> - <th>Birth Date</th> - <th>Type</th> - <th>Owner</th> - </tr> - </thead> - <tr> - <td><c:out value="${visit.pet.name}"/></td> - <td><fmt:formatDate value="${visit.pet.birthDate}" pattern="yyyy/MM/dd"/></td> - <td><c:out value="${visit.pet.type.name}"/></td> - <td><c:out value="${visit.pet.owner.firstName} ${visit.pet.owner.lastName}"/></td> - </tr> - </table> - - <form:form modelAttribute="visit" class="form-horizontal"> - <div class="form-group has-feedback"> - <petclinic:inputField label="Date" name="date"/> - <petclinic:inputField label="Description" name="description"/> - </div> - - <div class="form-group"> - <div class="col-sm-offset-2 col-sm-10"> - <input type="hidden" name="petId" value="${visit.pet.id}"/> - <button class="btn btn-default" type="submit">Add Visit</button> - </div> - </div> - </form:form> - - <br/> - <b>Previous Visits</b> - <table class="table table-striped"> - <tr> - <th>Date</th> - <th>Description</th> - </tr> - <c:forEach var="visit" items="${visit.pet.visits}"> - <c:if test="${!visit['new']}"> - <tr> - <td><fmt:formatDate value="${visit.date}" pattern="yyyy/MM/dd"/></td> - <td><c:out value="${visit.description}"/></td> - </tr> - </c:if> - </c:forEach> - </table> - </jsp:body> - -</petclinic:layout> 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 a46434a..0000000 --- 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" %> - -<petclinic:layout pageName="vets"> - <h2>Veterinarians</h2> - - <table id="vets" class="table table-striped"> - <thead> - <tr> - <th>Name</th> - <th>Specialties</th> - </tr> - </thead> - <tbody> - <c:forEach items="${vets.vetList}" var="vet"> - <tr> - <td> - <c:out value="${vet.firstName} ${vet.lastName}"/> - </td> - <td> - <c:forEach var="specialty" items="${vet.specialties}"> - <c:out value="${specialty.name} "/> - </c:forEach> - <c:if test="${vet.nrOfSpecialties == 0}">none</c:if> - </td> - </tr> - </c:forEach> - </tbody> - </table> - - <table class="table-buttons"> - <tr> - <td> - <a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a> - </td> - <td> - <a href="<spring:url value="/vets.json" htmlEscape="true" />">View as JSON</a> - </td> - </tr> - </table> -</petclinic:layout> 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 b801ec6..0000000 --- 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" %> - -<petclinic:layout pageName="home"> - <h2><fmt:message key="welcome"/></h2> - <div class="row"> - <div class="col-md-12"> - <spring:url value="/resources/images/pets.png" htmlEscape="true" var="petsImage"/> - <img class="img-responsive" src="${petsImage}"/> - </div> - </div> -</petclinic:layout> 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 cd14d87..0000000 --- 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" %> - -<petclinic:menu name="${menuName}"/> 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 74179d7..0000000 --- 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 --%> -<spring:url value="/webjars/jquery/2.2.4/jquery.min.js" var="jQuery"/> -<script src="${jQuery}"></script> - -<%-- jquery-ui.js file is really big so we only load what we need instead of loading everything --%> -<spring:url value="/webjars/jquery-ui/1.11.4/jquery-ui.min.js" var="jQueryUiCore"/> -<script src="${jQueryUiCore}"></script> - -<%-- Bootstrap --%> -<spring:url value="/webjars/bootstrap/3.3.6/js/bootstrap.min.js" var="bootstrapJs"/> -<script src="${bootstrapJs}"></script> - 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 323cca4..0000000 --- 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 ---%> - -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <%-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --%> - - <spring:url value="/resources/images/favicon.png" var="favicon"/> - <link rel="shortcut icon" type="image/x-icon" href="${favicon}"> - - <title>PetClinic :: a Spring Framework demonstration</title> - - <%-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --%> - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> - - <spring:url value="/resources/generated/petclinic.css" var="petClinicCss"/> - <link href="${petClinicCss}" rel="stylesheet"/> - - <spring:url value="/webjars/jquery-ui/1.11.4/jquery-ui.min.css" var="jQueryUiCss"/> - <link href="${jQueryUiCss}" rel="stylesheet"/> - - <spring:url value="/resources/css/jquery-ui.theme.min.css" var="jQueryUiThemeCss"/> - <link href="${jQueryUiThemeCss}" rel="stylesheet"/> - -</head> 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 0db10f3..0000000 --- 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" %> - -<spring:bind path="${name}"> - <c:set var="cssGroup" value="form-group ${status.error ? 'has-error' : '' }"/> - <c:set var="valid" value="${not status.error and not empty status.actualValue}"/> - <div class="${cssGroup}"> - <label class="col-sm-2 control-label">${label}</label> - - <div class="col-sm-10"> - <form:input class="form-control" path="${name}"/> - <c:if test="${valid}"> - <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> - </c:if> - <c:if test="${status.error}"> - <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span> - <span class="help-inline">${status.errorMessage}</span> - </c:if> - </div> - </div> -</spring:bind> 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 870c735..0000000 --- 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"%> - -<!doctype html> -<html> -<petclinic:htmlHeader/> - -<body> -<petclinic:bodyHeader menuName="${pageName}"/> - -<div class="container-fluid"> - <div class="container xd-container"> - - <jsp:doBody/> - - <petclinic:pivotal/> - </div> -</div> -<petclinic:footer/> -<jsp:invoke fragment="customScript" /> - -</body> - -</html> 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 6afb0f3..0000000 --- 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" %> - -<nav class="navbar navbar-default" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <a class="navbar-brand" href="<spring:url value="/" htmlEscape="true" />"><span></span></a> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar"> - <span class="sr-only"><os-p>Toggle navigation</os-p></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - </div> - <div class="navbar-collapse collapse" id="main-navbar"> - <ul class="nav navbar-nav navbar-right"> - - <petclinic:menuItem active="${name eq 'home'}" url="/" title="home page"> - <span class="glyphicon glyphicon-home" aria-hidden="true"></span> - <span>Home</span> - </petclinic:menuItem> - - <petclinic:menuItem active="${name eq 'owners'}" url="/owners/find.html" title="find owners"> - <span class="glyphicon glyphicon-search" aria-hidden="true"></span> - <span>Find owners</span> - </petclinic:menuItem> - - <petclinic:menuItem active="${name eq 'vets'}" url="/vets.html" title="veterinarians"> - <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> - <span>Veterinarians</span> - </petclinic:menuItem> - - <petclinic:menuItem active="${name eq 'error'}" url="/oups.html" - title="trigger a RuntimeException to see how it is handled"> - <span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span> - <span>Error</span> - </petclinic:menuItem> - - </ul> - </div> - </div> -</nav> 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 8c14dbb..0000000 --- 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" %> - -<li class="${active ? 'active' : ''}"> - <a href="<spring:url value="${url}" htmlEscape="true" />" - title="${fn:escapeXml(title)}"> - <jsp:doBody/> - </a> -</li> 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 8ee35fb..0000000 --- a/src/main/webapp/WEB-INF/tags/pivotal.tag +++ /dev/null @@ -1,10 +0,0 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - -<br/> -<br/> -<div class="container"> - <div class="row"> - <div class="col-12 text-center"><img src="<spring:url value="/resources/images/spring-pivotal-logo.png" htmlEscape="true" />" - alt="Sponsored by Pivotal"/></div> - </div> -</div> 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 21fad89..0000000 --- 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" %> - -<spring:bind path="${name}"> - <c:set var="cssGroup" value="form-group ${status.error ? 'error' : '' }"/> - <c:set var="valid" value="${not status.error and not empty status.actualValue}"/> - <div class="${cssGroup}"> - <label class="col-sm-2 control-label">${label}</label> - - <div class="col-sm-10"> - <form:select class="form-control" path="${name}" items="${names}" size="${size}"/> - <c:if test="${valid}"> - <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> - </c:if> - <c:if test="${status.error}"> - <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span> - <span class="help-inline">${status.errorMessage}</span> - </c:if> - </div> - </div> -</spring:bind> diff --git a/src/main/webapp/bower_components/bower.json b/src/main/webapp/bower_components/bower.json deleted file mode 100644 index f2d86c7..0000000 --- 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 86d4c2d..0000000 --- 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 eff13ab..0000000 --- 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 8a1934c..237f0f4 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")); - } - - } -- GitLab