org.springframework.web.servlet.tags
Class 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
- All Implemented Interfaces:
- Serializable, IterationTag, JspTag, Tag, TryCatchFinally
public class TransformTag
- extends HtmlEscapingAwareTag
Tag for transforming reference data values from form controllers and
other objects inside a spring:bind
tag.
The BindTag has a PropertyEditor that it uses to transform properties of
a bean to a String, useable in HTML forms. This tag uses that PropertyEditor
to transform objects passed into this tag.
- Since:
- 20.09.2003
- Author:
- Alef Arendsen, Juergen Hoeller
- See Also:
BindTag
,
Serialized Form
Method Summary |
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. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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).
Like all of Spring's JSP tags, this tag is capable of parsing EL expressions
itself, on any JSP version. Note, however, that EL expressions in a JSP 2.0 page
will be evaluated by the JSP container, with the result getting passed in here.
For this reason, the type of this property is Object (accepting any result
object from a pre-evaluated expression) rather than String.
setVar
public void setVar(String var)
- Set PageContext attribute name under which to expose
a variable that contains the result of the transformation.
- See Also:
setScope(java.lang.String)
,
JspContext.setAttribute(java.lang.String, java.lang.Object)
setScope
public void setScope(String scope)
- Set the scope to export the variable to.
Default is SCOPE_PAGE ("page").
- See Also:
setVar(java.lang.String)
,
TagUtils.SCOPE_PAGE
,
JspContext.setAttribute(java.lang.String, java.lang.Object)
doStartTagInternal
protected final int doStartTagInternal()
throws JspException
- Description copied from class:
RequestContextAwareTag
- Called by doStartTag to perform the actual work.
- Specified by:
doStartTagInternal
in class RequestContextAwareTag
- Returns:
- same as TagSupport.doStartTag
- Throws:
JspException
- See Also:
TagSupport.doStartTag()
Copyright © 2002-2007 The Spring Framework.