This is my second tutorial about FreeMarker template engine. In my previous tutorial I have explained about how to create stand alone freemarker template. This tutorial explains how to integrate freemarker template to a servlet. 1. Setup FreeMarker Environemnt It is very simple to setup the freemarker environment by downloading the JAR distribution from its …
template engine
FreeMarker Template Hello World Example
1. Introduction to FreeMarker FreeMarker is a Java based template engine which can be used as stand-alone or servlet bases Java programs. You write a FreeMarker template in a plain text file with the place holders like ${id}. This file is saved with .ftl extension. Not only the simple text, we can also use the …
How To Use Switch Statement (th:switch) In Thymeleaf Template?
In my previous articles I have explained about the hello world example and the expression language. This tutorial explains how to use the switch statements inside Thymeleaf template. Thymeleaf provides th:switch attribute for using switch functionality. This feature is extension of my previous example on iteration in thymeleaf template. 1. Set Up Thymeleaf Application To …
How To Use th:each For Iteration In Thymeleaf Template?
In my previous articles I have explained about the hello world example and the expression language. This tutorial explains how to iterate the list of values from an object. For Iteration In Thymeleaf Template, it provides th:each attribue for using inside a table element to iterate over the list of objects and display the list. This …
How To Set Attributes in Thymeleaf Template using th:attr?
In my previous articles I have explained about the hello world example and the expression language. This tutorial explains how to set the attribute to the template at the time of processing. This feature is very useful for creating the templates. Thymeleaf provides very easy syntax for just adding the attributes dynamically from the properties …