Tutorial by Examples

To get started with Thymeleaf visit official download page. Maven dependency <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> <version>3.0.1.RELEASE</version> </dependency> Gradle dependency compile gr...
Example method in controller @RequestMapping(value = "/test") public String showCheckbox(Model model) { boolean myBooleanVariable = false; model.addAttribute("myBooleanVariable", myBooleanVariable); return "sample-checkbox"; } View: sample-checkbox....
To submit form via Ajax with Jquery : <div id="yourPanel" th:fragment="yourFragment"> <form id="yourForm" method="POST" th:action="@{/actions/postForm}" th:object="${yourFormBean}">...
If you want to replace parts of your website, ajax is an easy way to do it. The website.html where you want to replace the content based on the selected value: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> ...
Form object package formSubmission; public class Person { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name= name; } public int getAge() { return age; ...

Page 1 of 1