Spring Framework

Class TransformTag

  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.springframework.web.servlet.tags.RequestContextAwareTag
          extended by org.springframework.web.servlet.tags.HtmlEscapingAwareTag
              extended by org.springframework.web.servlet.tags.TransformTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class TransformTag
extends HtmlEscapingAwareTag

Tag for transforming reference data values from form controllers and other objects inside a spring: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, useable in HTML forms. This tag uses that PropertyEditor to transform objects passed into this tag.

Alef Arendsen, Juergen Hoeller
See Also:
BindTag, Serialized Form

Field Summary
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
Fields inherited from interface javax.servlet.jsp.tagext.Tag
Constructor Summary
Method Summary
protected  int doStartTagInternal()
          Called by doStartTag to perform the actual work.
 void setScope(java.lang.String scope)
          Set the scope to export the variable to.
 void setValue(java.lang.Object value)
          Set the value to transform, using the appropriate PropertyEditor from the enclosing BindTag.
 void setVar(java.lang.String var)
          Set PageContext attribute name under which to expose a variable that contains the result of the transformation.
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isDefaultHtmlEscape, isHtmlEscape, setHtmlEscape
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
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

Constructor Detail


public TransformTag()
Method Detail


public void setValue(java.lang.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.


public void setVar(java.lang.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)


public void setScope(java.lang.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)


protected final int doStartTagInternal()
                                throws javax.servlet.jsp.JspException
Description copied from class: RequestContextAwareTag
Called by doStartTag to perform the actual work.

Specified by:
doStartTagInternal in class RequestContextAwareTag
same as TagSupport.doStartTag
See Also:

Spring Framework