EncodeHTMLTagpublic class EncodeHTMLTag extends BodyTagSupport This class is a tag handler for custom action that replaces
HTML special characters in its body with the corresponding
HTML character entities. |
Methods Summary |
---|
public int | doAfterBody()Reads the body content, converts all HTML special characters
with the corresponding HTML character entities, and adds the
result to the response body.
BodyContent bc = getBodyContent();
JspWriter out = getPreviousOut();
try {
out.write(StringFormat.toHTMLString(bc.getString()));
}
catch (IOException e) {} // Ignore
return SKIP_BODY;
|
|