Skip to content

A template translation tool for Java, inspired by JSP

License

Notifications You must be signed in to change notification settings

hexaredecimal/JTempl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JTempl

A html/Template to java class translation tool

Why?

Hard to find standalone tools that do this which are not intergrated with some system

Features

  • Simple Syntax (Uses %% instead of context based tags unlike jsp (<= vs <% etc))
  • Translates to readable java code
  • Repl support

Usage

$ jtmpl -p com.your.webapp -d src/com/your/web/app index.xhtml

This will create a file called Index.java with the template code inside a static method called generate.

You can use the template like this in your code, especially when using BlazingwebX.

@Get("/")
public static home(BlazingResponse response) {
    var page = IndexTemplate.generate();
    response.setHeader("Content-Type", "text/html");
    response.sendResponse(page);
}

Examples

JTempl has a syntax similar to JSP and uses %% to start and end template insertions. Examples are available in the examples directory.

About

A template translation tool for Java, inspired by JSP

Resources

License

Stars

Watchers

Forks

Packages

No packages published