FreeMarker Template Hello World Example

freemarker-thumbnail

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?

thymeleaf

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?

thymeleaf

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?

thymeleaf

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 […]

Get URL Content using Java

java

This example shows how to download a URL content to your local machine. If you look at the below example, it simply takes an URL as the input and get the content and save it to the local system. File Upload and Download Using Java

How To Increase Heap Size in Eclipse?

eclipse1

If you get the error java.lang.OutOfMemoryError: Java heap space while running Java applications, it means that your Java application environment don’t have the sufficient space to store the values needed for your application. This could be because of the following reasons: By mistake, you have set the less memory for your Java environment (or) Your […]

Convert Java Project to Web Project in Eclipse

eclipse1

This tutorial is for adding a simple tips to the Eclipse developers. When you have a Java project already created in your eclipse, now you want to convert that same project to a Web project instead of creating a new project. We can do that easily using the property window for that specific project. 1. […]

Deployment Descriptor in Different Servlet Versions

java-jee

In this tutorial I will post the list of web.xml file used in the previous versions of servlet. This will help you to understand the evolution of servlet configuration file and the latest improvements. New Features in Servlet 3.0 What is load on startup element in web.xml file 1. Servlet 2.3 This version uses the […]

org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating OGNL expression

thymeleaf

When you work with Thymeleaf application, you would have encountered the TemplateProcessingException exceptions. The problem is the use of default context variables. It could be because of Wrong use of the context variable name (or) The property name accessed by the context variable object is not correct.

Context Objects in Thymeleaf

thymeleaf

In my previous article I have explained about the different types of expression languages used in Thymeleaf framework. If you have worked with JSP or any other web frameworks, there are number of implicit objects available in the context for the free use. These objects are created by the container and made it available with […]