Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Freemarker escaping freemarker

Tags:

freemarker

I'm using freemarker to generate a freemarker template. But I need some way to escape freemarker tags.

How would I escape a <#list> tag or a ${expression} ?

like image 409
tuler Avatar asked Oct 29 '09 02:10

tuler


People also ask

What does C mean in FreeMarker?

c (when used with numerical value) This built-in converts a number to string for a "computer language" as opposed to for human audience. That is, it formats with the rules that programming languages used to use, which is independent of all the locale and number format settings of FreeMarker.

What is a FreeMarker error?

If FreeMarker is formatted incorrectly within an email template, you may experience a render error when you attempt to send the email. If your email has a render error, it cannot be processed or sent out.

Does FreeMarker have content?

The has_content FunctionFreeMarker has built-in functions to detect for variables. The most common method of detecting for empty or null values uses the has_content function and the trim function. The has_content function is often used with another built-in FreeMarker function to detect for null values.

How do you comment out a FreeMarker?

Comments: <#-- and --> Comments are similar to HTML comments, but they are delimited by <#-- and -->. Comments will be ignored by FreeMarker, and will not be written to the output.


1 Answers

You could also use: ${"$"}{expression} if you find the {} nesting confusing.

like image 58
monzonj Avatar answered Oct 04 '22 15:10

monzonj