Home » freemarker-2.3.13 » freemarker.template.utility » [javadoc | source]
freemarker.template.utility
public class: HtmlEscape [javadoc | source]
java.lang.Object
   freemarker.template.utility.HtmlEscape

All Implemented Interfaces:
    TemplateTransformModel

Performs an HTML escape of a given template fragment. Specifically, < > " and & are all turned into entities.

Usage:
From java:

SimpleHash root = new SimpleHash();

root.put( "htmlEscape", new freemarker.template.utility.HtmlEscape() );

...

From your FreeMarker template:


The following is HTML-escaped:
<transform htmlEscape>
<p>This paragraph has all HTML special characters escaped.</p>
</transform>

...
Method from freemarker.template.utility.HtmlEscape Summary:
getWriter
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.template.utility.HtmlEscape Detail:
 public Writer getWriter(Writer out,
    Map args)