类 TransformTag
- 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.TransformTag
- 所有已实现的接口:
Serializable
,IterationTag
,JspTag
,Tag
,TryCatchFinally
public class TransformTag extends HtmlEscapingAwareTag
The<transform>
tag provides transformation for reference data values from controllers and other objects inside aspring:bind
tag (or a data-bound form element tag from Spring's form tag library).The BindTag has a PropertyEditor that it uses to transform properties of a bean to a String, usable in HTML forms. This tag uses that PropertyEditor to transform objects passed into this tag.
Attribute Summary Attribute Required? Runtime Expression? Description htmlEscape false true Set HTML escaping for this tag, as boolean value. Overrides the default HTML escaping setting for the current page. scope false true The scope to use when exported the result to a variable. This attribute is only used when var is also set. Possible values are page, request, session and application. value true true The value to transform. This is the actual object you want to have transformed (for instance a Date). Using the PropertyEditor that is currently in use by the 'spring:bind' tag. var false true The string to use when binding the result to the page, request, session or application scope. If not specified, the result gets outputted to the writer (i.e. typically directly to the JSP).
字段概要
从类继承的字段 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
构造器概要
构造器 构造器 说明 TransformTag()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected int
doStartTagInternal()
Called by doStartTag to perform the actual work.void
setScope(String scope)
Set the scope to export the variable to.void
setValue(Object value)
Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.void
setVar(String var)
Set PageContext attribute name under which to expose a variable that contains the result of the transformation.从类继承的方法 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
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
构造器详细资料
TransformTag
public TransformTag()
方法详细资料
setValue
public void setValue(Object value)
Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.The value can either be a plain value to transform (a hard-coded String value in a JSP or a JSP expression), or a JSP EL expression to be evaluated (transforming the result of the expression).
setVar
public void setVar(String var)
Set PageContext attribute name under which to expose a variable that contains the result of the transformation.
setScope
public void setScope(String scope)
Set the scope to export the variable to. Default is SCOPE_PAGE ("page").
doStartTagInternal
protected final int doStartTagInternal() throws JspException
从类复制的说明:RequestContextAwareTag
Called by doStartTag to perform the actual work.- 指定者:
doStartTagInternal
在类中RequestContextAwareTag
- 返回:
- same as TagSupport.doStartTag
- 抛出:
JspException
- 另请参阅:
TagSupport.doStartTag()