Tool for working with escaping in Velocity templates.
It provides methods to escape outputs for Java, JavaScript, HTML, XML and SQL. Also provides methods to render VTL characters that otherwise needs escaping.
String using Java String rules.
null if null string input.
Delegates the process to StringEscapeUtils#escapeJava(String).
If $java had the following value:
then the following Velocity script:
produces this output:
String using JavaScript String rules.
null if null string input.
Delegates the process to StringEscapeUtils#escapeJavaScript(String).
If $javascript had the following value:
then the following Velocity script:
produces this output:
String using HTML entities.
String, null if null string input
Delegates the process to StringEscapeUtils#escapeHtml(String).
If $html had the following value:
then the following Velocity script:
produces this output:
String to be suitable to use as an HTTP parameter value.
String, null if null string input
Delegates the process to java.net.URLEncoder#encodeURL(String,"UTF-8").
If $http had the following value:
then the following Velocity script:
produces this output:
String using XML entities.
String, null if null string input
Delegates the process to StringEscapeUtils#escapeXml(String).
If $xml had the following value:
then the following Velocity script:
produces this output:
String to be suitable to pass to an SQL query.
null if null string input
Delegates the process to StringEscapeUtils#escapeSql(String).
If $sql had the following value:
then the following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output:
The following Velocity script:
produces this output: