public class IlvServletHTMLUtil extends Object
The HTML constructed by this class can be serialized as a pure ASCII string and is therefore safe to send to a browser client.
Modifier and Type | Method and Description |
---|---|
static String |
escapeForHTMLAttribute(String s)
Converts a string to HTML syntax, for including in an HTML attribute.
|
static String |
escapeForHTMLElement(String s)
Converts a string to HTML syntax, for including in an HTML element.
|
static String |
escapeForHTMLElementVariableSpaces(String s)
Converts a string to HTML syntax, for including in an HTML element.
|
static String |
escapeForURLQueryParameter(String s)
Encodes a string so that it can be used as part of a URL query parameter.
|
public static String escapeForHTMLElement(String s)
Note: The resulting string is not a valid HTML document; you need to
wrap it in <html>
.../<html>
if
you want a complete HTML document.
s
- The string to be converted. It should not contain tab characters.public static String escapeForHTMLAttribute(String s)
Note: You usually need to wrap the resulting string in double-quotes.
s
- The string to be converted. It should not contain tab or newline
characters.public static String escapeForHTMLElementVariableSpaces(String s)
escapeForHTMLElement(java.lang.String)
but does not
convert spaces into sequences.
Note: The resulting string is not a valid HTML document; you need to
wrap it in <html>
.../<html>
if
you want a complete HTML document.
s
- The string to be converted. It should not contain tab characters.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.