life is too short for a diary

Dear Vishi, daily log on Feb 07, 2023.

Tags: diary letters

Written by: Tushar Sharma

Dear Vishi, this is my daily log for Feb 07, 2023.


Do you know what a horseplay is? As expected in English, it has nothing to do with horses. Horseplay is a rough play or pranks in which people push or hit each other or behave in a silly way.


Mustache is a template engine for Java. To add it's dependency


Define a mustache template..

<h1>Hello {{name}}!</h1>

Create a Java class to hold the data:

public class HelloMessage {
    private String name;
    public HelloMessage(String name) { = name;
    public String getName() {
        return name;

Render the template

MustacheFactory mf = new DefaultMustacheFactory();
Mustache mustache = mf.compile("template.mustache");
HelloMessage message = new HelloMessage("John Doe");
StringWriter writer = new StringWriter();
mustache.execute(writer, message).flush();

This will print

<h1>Hello John Doe!</h1>

comments powered by Disqus