Tagged: thymeleaf

SpringBoot + Thymeleaf + i18n (Internationalization)

Hello again. This week I had to study how to implement i18n in a Spring Boot + Thymeleaf CRM application I am developing. Spring Boot really makes it easy to setup but while I was searching about it on the Web I found a lot of misinformation and so I decided to make a post about it. As usual, you can find the complete project on Github: https://github.com/mtrojahn/springboot-thymeleaf-i18n. Let’s start by the pom.xml:

Application.groovy

As you can see, Application.groovy is pretty much the default for any Spring Boot application. I only changed @ComponentScan to lookup the package that...

Spring Boot / Thymeleaf: Fragments via Ajax

This is probably not the best approach and you guys can feel free to correct me in the comments section, but here is a simple tutorial on how I’m getting my fragments loaded via ajax. Same as before, the full project is on my Github: https://github.com/mtrojahn/spring-thymeleaf-fragments-from-ajax Let’s get to it: MyController.groovy

Very simple controller. Nothing special except for the fact it’s returning Thymeleaf fragmets from /resources/templates/fragments. As you probably noticed, for the sake of this example, each fragment is recieving it’s “content” from the controller. Here’s a fragment: frag1.html

Now the index.html

Each button has it’s event and is calling...

%d bloggers like this: