类 HtmlEscapingAwareTag
- java.lang.Object
- javax.servlet.jsp.tagext.TagSupport
- org.springframework.web.servlet.tags.RequestContextAwareTag
- org.springframework.web.servlet.tags.HtmlEscapingAwareTag
- 所有已实现的接口:
Serializable
,IterationTag
,JspTag
,Tag
,TryCatchFinally
- 直接已知子类:
AbstractFormTag
,BindErrorsTag
,BindTag
,EscapeBodyTag
,EvalTag
,MessageTag
,TransformTag
,UrlTag
public abstract class HtmlEscapingAwareTag extends RequestContextAwareTag
Superclass for tags that output content that might get HTML-escaped.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.- 从以下版本开始:
- 1.1
- 作者:
- Juergen Hoeller, Brian Clozel
- 另请参阅:
setHtmlEscape(boolean)
,HtmlEscapeTag
,RequestContext.isDefaultHtmlEscape()
,WebUtils.getDefaultHtmlEscape(javax.servlet.ServletContext)
,WebUtils.getResponseEncodedHtmlEscape(javax.servlet.ServletContext)
, 序列化表格
字段概要
从类继承的字段 org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
从类继承的字段 javax.servlet.jsp.tagext.TagSupport
id, pageContext
从接口继承的字段 javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
从接口继承的字段 javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
构造器概要
构造器 构造器 说明 HtmlEscapingAwareTag()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
htmlEscape(String content)
HTML-encodes the given String, only if the "htmlEscape" setting is enabled.protected boolean
isDefaultHtmlEscape()
Return the applicable default HTML escape setting for this tag.protected boolean
isHtmlEscape()
Return the HTML escaping setting for this tag, or the default setting if not overridden.protected boolean
isResponseEncodedHtmlEscape()
Return the applicable default for the use of response encoding with HTML escaping for this tag.void
setHtmlEscape(boolean htmlEscape)
Set HTML escaping for this tag, as boolean value.从类继承的方法 org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, doStartTagInternal, getRequestContext
从类继承的方法 javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
构造器详细资料
HtmlEscapingAwareTag
public HtmlEscapingAwareTag()
方法详细资料
setHtmlEscape
public void setHtmlEscape(boolean htmlEscape) throws JspException
Set HTML escaping for this tag, as boolean value. Overrides the default HTML escaping setting for the current page.
isHtmlEscape
protected boolean isHtmlEscape()
Return the HTML escaping setting for this tag, or the default setting if not overridden.
isDefaultHtmlEscape
protected boolean isDefaultHtmlEscape()
Return the applicable default HTML escape setting for this tag.The default implementation checks the RequestContext's setting, falling back to
false
in case of no explicit default given.
isResponseEncodedHtmlEscape
protected boolean isResponseEncodedHtmlEscape()
Return the applicable default for the use of response encoding with HTML escaping for this tag.The default implementation checks the RequestContext's setting, falling back to
false
in case of no explicit default given.- 从以下版本开始:
- 4.1.2
- 另请参阅:
RequestContextAwareTag.getRequestContext()
htmlEscape
protected String htmlEscape(String content)
HTML-encodes the given String, only if the "htmlEscape" setting is enabled.The response encoding will be taken into account if the "responseEncodedHtmlEscape" setting is enabled as well.
- 参数:
content
- the String to escape- 返回:
- the escaped String
- 从以下版本开始:
- 4.1.2
- 另请参阅:
isHtmlEscape()
,isResponseEncodedHtmlEscape()