Skip to content

Escape

Following functions help you * Escape and unescape strings from JSON, HTML, XML and SQL (Usage of StringEscapeUtils). * Encode and decode strings for URL (Usage of URLEncoder and URLDecoder).

JSON🔗

String escapeJson(String text)

Examples :

SpEL : ${#escapeJson("text")}

String unescapeJson(String text)

Examples :

SpEL : ${#unescapeJson("text")}

HTML🔗

String escapeHtml3(String text)

Examples :

SpEL : ${#escapeHtml13("text")}

String escapeHtml4(String text)

Examples :

SpEL : ${#escapeHtml14("text")}

String unescapeHtml3(String text)

Examples :

SpEL : ${#unescapeHtml3("text")}

String unescapeHtml4(String text)

Examples :

SpEL : ${#unescapeHtml4("text")}

SQL🔗

String escapeSql(String sql)

Examples :

SpEL : ${#escapeSql("sql")}

XML🔗

String unescapeXml(String text)

Examples :

SpEL : ${#unescapeXml("text")}

String escapeXml10(String text)

Examples :

SpEL : ${#escapeXml10("text")}

String escapeXml11(String text)

Examples :

SpEL : ${#escapeXml11("text")}

URL🔗

String urlEncode(String toEncode, String charset)

If charset is null, use the default charset.

Examples :

SpEL : ${#urlEncode("text", null)}

String urlDecode(String toDecode, String charset)

If charset is null, use the default charset.

Examples :

SpEL : ${#urlDecode("text", null)}