Spark Java Views Using Thymeleaf
The next step in using Spark Java with Groovy that I would like to look at is getting data into a view. With Grails, we’re used to using GSP pages - and they work great, but Spark Java doesn’t have view support out of the box. Instead, it let’s you choose a template engine. The alternative is to simply serve static HTML pages and retrieve any data via Ajax calls. That’s a valid strategy in some cases, but most sites will require some level of dynamic data in the view and requiring Ajax for all of that data isn’t always the best solution. Enter Thymeleaf. In their words:








\

