Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreWe are pleased to announce that the Spring Petclinic sample application has been refactored.
The source code is now available on github. Here is a screenshot of the new application:And here is an overview of the new architecture:
We have used the following Spring features:
We have had quite a lot of contributions from experts in our community (including the leads of several open source projects).
In case you haven’t heard of it yet, Thymeleaf can be seen as a replacement for JSP. it defines itself as an XML / XHTML / HTML5 template engine.
It is based on some plain HTML files with a little bit of namespace magic.
Daniel and Soraya from the Thymeleaf project have created a Spring-Petclinic branch that uses Thymeleaf instead of JSP. They have documented the migration steps in this blog entry: http://www.thymeleaf.org/petclinic.html
The Thymeleaf branch of Spring Petclinic is available here: https://github.com/thymeleaf/thymeleafexamples-petclinic
To learn more about Thymeleaf: http://www.thymeleaf.org
To follow Thymeleaf on twitter: https://twitter.com/thymeleaf
Dandelion provides a set of taglibs that you can use with JSP or Thymeleaf.
We have used it inside Spring-Petclinic to work with DataTables. It generates tables based on jQuery DataTables and Bootstrap.
You can do things like that:
<datatables:table data="${ownerList}" id="dataTable" theme="bootstrap2" export="pdf">
<datatables:column title="Name" property="name" sortable="true" />
<datatables:column title="Address" property="address" sortable="true" />
</datatables:table>
The output html table then looks like this:
Dandelion is used inside the main branch of Spring Petclinic.
Thibault Duchateau from the Dandelion project has written a nice blog entry that describes the migration of the Spring Petclinic application
To learn more about Dandelion: http://dandelion.github.com/To follow them on twitter: https://twitter.com/dandelion_proj
By default, Spring Petclinic uses Maven as it is the most common choice for Java applications. While Spring Petclinic is fairly small in comparison to most real-life applications, its Maven pom.xml file is pretty verbose already.
Li Yanhui from Thoughtworks China has been nice enough to migrate Spring Petclinic to Gradle. That is a great way to compare Maven and Gradle side by side. The build.gradle configuration file is indeed much simpler to understand. It currently contains 143 lines (as opposed to 543 lines for the Maven POM).
You can browse the Gradle-based version of Spring Petclinic here: https://github.com/whimet/spring-petclinic Thanks to them we have been able to identify a few places inside Spring Petclinic that contained code duplication and lacked of automated testing.
Would it be possible to take Spring Petclinic as it is now and scale it up to 1000 requests per second on a single server instance? Julien Dubois from Ippon Technologies has written a great series of five blog entries on that topic.
It answers questions such as: - Should I rely on the session context? (part 2) - Which Apache Tomcat connector should I use? (part 2) - Which database connection pool should I use? (part 3) - Is JDBC faster than JPA or Spring Data JPA? ( part 4) - What are the pros of using OpenSessionInViewFilter? ( part 4)
Spring Petclinic on GitHub Spring Petclinic on Cloud Foundry Petclinic + Thymeleaf Petclinic + Gradle