|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.util.HtmlUtils
Utility class for HTML escaping. Escapes and unescapes based on the W3C HTML 4.01 recommendation.
Reference: http://www.w3.org/TR/html4/charset.html
Constructor Summary | |
HtmlUtils()
|
Method Summary | |
static java.lang.String |
htmlEscape(java.lang.String s)
Turn special characters into HTML character references. |
static java.lang.String |
htmlUnescape(java.lang.String s)
Turn HTML character references into their plain text UNICODE equivalent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HtmlUtils()
Method Detail |
public static java.lang.String htmlEscape(java.lang.String s)
Escapes all special characters to their corresponding numerial reference in the decimal format: Decimal;
Reference: http://www.w3.org/TR/html4/sgml/entities.html
public static java.lang.String htmlUnescape(java.lang.String s)
Handles complete character set defined in HTML 4.01 recommendation and all reference types (decimal, hex, and entity).
Correctly converts the following formats:
Decimal; - (Example: D)Gracefully handles malformed character references by copying original characters as is when encountered.
Hex;
- (Example: å) case insensitive Entity; - (Example: &) case sensitive
Reference: http://www.w3.org/TR/html4/sgml/entities.html
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |