FreeMarker Hello World
It’s one more template engine in the line to generate text output. It’s java class library to use in java programming. People generally use this template to generate HTML page and its good fit in any MVC application if you want to avoid JSP and keep your client page neat and clean. Basic idea behind this template is to keep HTML designer separate from java programmer where both can work independently. Java programmer writes application logic and designer works on html page design and finally all static data could be replace using FreeMarker engine. Below is high level diagram:
To understand how this template works please follow below steps to Print hello world.
- Maven project structure:
Important: You will have to include freemarker.x.x.x.jar.
- Once you setup your project right click FreeMarkerHelloWorld.java –> Run As –> Java Application you will see below out on console and file:
- For more information please visit here
Download Project: FreeMarkerHelloWorld