Spring Boot and Polymer

Last week was the Google I/O Developer conference and Polymer 1.0 was presented. So finally my curiosity was sparked and I made some time to check it out a little bit.  I was looking for a fast way to create a JAVA Web Application where I can use Polymer so I heard about how easy and fast Spring Boot is.

So voilà, my first JAVA Web App with Spring Boot and Polymer 1.0. You can clone it from Git and use it as a archetype – the Polymer files are included in the project already. (also for learning purposes). I used Maven to build the project, which is also easy. But one can also use Gradle.

https://github.com/theRealImy/SpringBootPolymer

Using Spring Boot was super easy! One can simply follow the Getting started

Polymer is home here

The only issue I encountered was that the index.html was not displayed. After a bit of reading, in the Spring Boot docu you find:

Do not use the src/main/webapp directory if your application will be packaged as a jar…

By default Spring Boot will serve static content from a directory called /static (or /public or /resources or /META-INF/resources) in the classpath or from the root of the ServletContext.

Fast enough, I changed the folder name and it worked.

Viel Spaß!