org.springframework.web.util
Class HtmlUtils


public abstract class HtmlUtils

Utility class for HTML escaping and unescaping. Based on code from com.purpletech.util.Utils, written by Alex Chaffee.

Reference: http://hotwired.lycos.com/webmonkey/reference/special_characters/

Author:
Juergen Hoeller
Since: 01.03.2003

Method Summary
 static StringhtmlEscape(String source)
          Turns funky characters into HTML entity equivalents.
 static StringhtmlUnescape(String source)
          Reverses htmlEscape.

Method Detail

htmlEscape

public static String htmlEscape(String source)
Turns funky characters into HTML entity equivalents.

E.g. "bread" & "butter" => "bread" & "butter"

Update: supports nearly all HTML entities, including funky accents. See the source code for more detail.


htmlUnescape

public static String htmlUnescape(String source)
Reverses htmlEscape.

Association Links

to Class java.util.Map

to Class java.util.Map