What are secure templates in Java?

I am looking for a template mechanism in Java that prohibits code execution in a template, only tags.

In an ideal world, I would look for the equivalent of Jinja2 (or the Django template engine ). Based on Django, the template tags will be used when I create it, but the user will not be able to create the template tag (by executing the code).

I would do it on Play! Framework .

Thank you for your help!

+5
source share
3 answers

StringTemplate is what you are looking for.

. ;

+5

, , , , JSP- ( <% % > ) / ...

, Thymeleaf http://www.thymeleaf.org ( JSP), - . , , Velocity http://velocity.apache.org, !

+1

, , , , , , . , :) java Snippetory. , , .

+1

All Articles