类 EscapeBodyTag
- java.lang.Object
- javax.servlet.jsp.tagext.TagSupport
- org.springframework.web.servlet.tags.RequestContextAwareTag
- org.springframework.web.servlet.tags.HtmlEscapingAwareTag
- org.springframework.web.servlet.tags.EscapeBodyTag
- 所有已实现的接口:
Serializable
,BodyTag
,IterationTag
,JspTag
,Tag
,TryCatchFinally
public class EscapeBodyTag extends HtmlEscapingAwareTag implements BodyTag
Custom JSP tag to escape its enclosed body content, applying HTML escaping and/or JavaScript escaping.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.
- 从以下版本开始:
- 1.1.1
- 作者:
- Juergen Hoeller
- 另请参阅:
HtmlUtils
,JavaScriptUtils
, 序列化表格
字段概要
从类继承的字段 org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
从类继承的字段 javax.servlet.jsp.tagext.TagSupport
id, pageContext
从接口继承的字段 javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
从接口继承的字段 javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
从接口继承的字段 javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
构造器概要
构造器 构造器 说明 EscapeBodyTag()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.从类继承的方法 org.springframework.web.servlet.tags.HtmlEscapingAwareTag
htmlEscape, isDefaultHtmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscape
从类继承的方法 org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
从类继承的方法 javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
构造器详细资料
EscapeBodyTag
public EscapeBodyTag()
方法详细资料
setJavaScriptEscape
public void setJavaScriptEscape(boolean javaScriptEscape) throws JspException
Set JavaScript escaping for this tag, as boolean value. Default is "false".- 抛出:
JspException
doStartTagInternal
protected int doStartTagInternal()
从类复制的说明:RequestContextAwareTag
Called by doStartTag to perform the actual work.- 指定者:
doStartTagInternal
在类中RequestContextAwareTag
- 返回:
- same as TagSupport.doStartTag
- 另请参阅:
TagSupport.doStartTag()
doInitBody
public void doInitBody()
- 指定者:
doInitBody
在接口中BodyTag
setBodyContent
public void setBodyContent(BodyContent bodyContent)
- 指定者:
setBodyContent
在接口中BodyTag
doAfterBody
public int doAfterBody() throws JspException
- 指定者:
doAfterBody
在接口中IterationTag
- 覆盖:
doAfterBody
在类中TagSupport
- 抛出:
JspException
readBodyContent
protected String readBodyContent() throws IOException
Read the unescaped body content from the page.- 返回:
- the original content
- 抛出:
IOException
- if reading failed
writeBodyContent
protected void writeBodyContent(String content) throws IOException
Write the escaped body content to the page.Can be overridden in subclasses, e.g. for testing purposes.
- 参数:
content
- the content to write- 抛出:
IOException
- if writing failed