public class EscapeBodyTag extends HtmlEscapingAwareTag implements BodyTag
Provides a "htmlEscape" property for explicitly specifying whether to apply HTML escaping. If not set, a page-level default (e.g. from the HtmlEscapeTag) or an application-wide default (the "defaultHtmlEscape" context-param in web.xml) is used.
Provides a "javaScriptEscape" property for specifying whether to apply JavaScript escaping. Can be combined with HTML escaping or used standalone.
HtmlUtils,
JavaScriptUtils,
Serialized Formlogger, REQUEST_CONTEXT_PAGE_ATTRIBUTEid, pageContextEVAL_BODY_BUFFERED, EVAL_BODY_TAGEVAL_BODY_AGAINEVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE| Constructor and Description |
|---|
EscapeBodyTag() |
| Modifier and Type | Method and Description |
|---|---|
int |
doAfterBody() |
void |
doInitBody() |
protected int |
doStartTagInternal()
Called by doStartTag to perform the actual work.
|
protected String |
readBodyContent()
Read the unescaped body content from the page.
|
void |
setBodyContent(BodyContent bodyContent) |
void |
setJavaScriptEscape(boolean javaScriptEscape)
Set JavaScript escaping for this tag, as boolean value.
|
protected void |
writeBodyContent(String content)
Write the escaped body content to the page.
|
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscapedoCatch, doFinally, doStartTag, getRequestContextdoEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoEndTag, doStartTag, getParent, release, setPageContext, setParentpublic void setJavaScriptEscape(boolean javaScriptEscape)
throws JspException
JspExceptionprotected int doStartTagInternal()
RequestContextAwareTagdoStartTagInternal in class RequestContextAwareTagTagSupport.doStartTag()public void doInitBody()
doInitBody in interface BodyTagpublic void setBodyContent(BodyContent bodyContent)
setBodyContent in interface BodyTagpublic int doAfterBody()
throws JspException
doAfterBody in interface IterationTagdoAfterBody in class TagSupportJspExceptionprotected String readBodyContent() throws IOException
IOException - if reading failedprotected void writeBodyContent(String content) throws IOException
Can be overridden in subclasses, e.g. for testing purposes.
content - the content to writeIOException - if writing failed