Smart-like template engine for java?

Is there any template mechanism (open source) similar to Smart? I want to make it easier for users to create their templates in HTML and then use them for which the smarty template is really suitable. JTPL is close to my example of what I'm looking for, but I want the "foreach" part in the template to allow users to customize the result pages. The lighter the better!

+5
source share
4 answers

StringTemplate is a popular lightweight Java template engine. Also, read these instructions on creating web pages using a StringTemplate .

+1

Velocity - , .

+3

Freemarker . Velocity, .

+3

Rythm - Java Razor, ( 2 - 3 , Velocity FM), :

String result = Rythm.render("hello @who!", "world");

Rythm String.format() . , Rythm.render 2x , String.format

:

Map<String, Object> args = new HashMap<String, Object>();
args.put("who", "world");
...
String result = Rythm.render("myTemplate.html", args);

Rythm , java (if-else, , ), , , , Java, , html .. http://play-rythm-demo.appspot.com/. ( , Play! Framework GAE!)

Play! Framework Rythm engine, , Rythm : http://www.playframework.org/modules/rythm p >

Rythm https://github.com/greenlaw110/rythm/downloads

There is also a Spring MVC plugin based on the Rythm Engine: https://github.com/lawrence0819/spring-web-rythm-template

+2
source

All Articles