org.apache.struts.taglib.tiles
Class PutTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--org.apache.struts.taglib.tiles.PutTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, ComponentConstants, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
AddTag

public class PutTag
extends javax.servlet.jsp.tagext.BodyTagSupport
implements ComponentConstants

Put an attribute in enclosing attribute container tag. Enclosing attribute container tag can be : <insert> or <definition>. Exception is thrown if no appropriate tag can be found. Put tag can have following atributes :

  • Value can also come from tag body. Tag body is taken into account only if value is not set by one of the tag attributes. In this case Attribute type is "string", unless tag body define another type.

    See Also:
    Serialized Form

    Field Summary
    protected  java.lang.String attributeName
              Name of attribute to put in component context
    private  java.lang.String beanName
              Bean name attribute
    private  java.lang.String beanProperty
              Bean property attribute
    private  java.lang.String beanScope
              Bean scope attribute
    private  java.lang.String direct
              JSP Template compatibility
    protected  java.lang.Object realValue
              cached real value computed from tag attributes
    private  java.lang.String role
              Role attribute
    private  java.lang.Object value
              associated attribute value
    private  java.lang.String valueType
              Requested type for the value
     
    Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
    bodyContent
     
    Fields inherited from class javax.servlet.jsp.tagext.TagSupport
    id, pageContext
     
    Fields inherited from interface org.apache.struts.taglib.tiles.ComponentConstants
    COMPONENT_CONTEXT, COMPONENT_SCOPE, EXCEPTION_KEY, LOCALE_KEY
     
    Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
    EVAL_BODY_BUFFERED, EVAL_BODY_TAG
     
    Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
    EVAL_BODY_AGAIN
     
    Fields inherited from interface javax.servlet.jsp.tagext.Tag
    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
     
    Constructor Summary
    PutTag()
              default constructor
     
    Method Summary
    protected  void callParent()
              Find parent tag which must implements AttributeContainer.
    protected  void computeRealValue()
              Compute real value according to tag attributes.
     int doEndTag()
              Do end tag
     int doStartTag()
              Do start tag
    protected  PutTagParent findEnclosingPutTagParent()
              Find parent tag which must implements AttributeContainer.
     java.lang.String getBeanName()
              Get property.
     java.lang.String getBeanProperty()
              Get property.
     java.lang.String getBeanScope()
              Get property.
     java.lang.String getContent()
              Get property Method added to satisfy Tomcat (bug ?)
     java.lang.String getName()
              Set property
     java.lang.Object getRealValue()
              Get real value according to tag attribute.
    protected  void getRealValueFromBean()
              Extract real value from specified bean.
     java.lang.String getRole()
              Get role attribute
     java.lang.String getType()
              Get property
     java.lang.String getValue()
              Set property.
     void release()
              Release all allocated resources.
    protected  void releaseInternal()
              Release internal properties.
     void setBeanName(java.lang.String value)
              Set property.
     void setBeanProperty(java.lang.String value)
              Set property.
     void setBeanScope(java.lang.String value)
              Set property.
     void setContent(java.lang.Object value)
              Set property
     void setContent(java.lang.String value)
              Set property Method added to satisfy Tomcat (bug ?)
     void setDirect(java.lang.String isDirect)
              Set property Method added for compatibility with JSP1.1
     void setName(java.lang.String value)
              Set property
     void setObjectValue(java.lang.Object value)
              Set property value as an object Added because some web container react badly to value as Object.
     void setRole(java.lang.String role)
              Set role attribute
     void setType(java.lang.String value)
              Set property
     void setValue(java.lang.Object value)
              Set property
     void setValue(java.lang.String value)
              Set property.
     
    Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
    doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
     
    Methods inherited from class javax.servlet.jsp.tagext.TagSupport
    findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface javax.servlet.jsp.tagext.BodyTag
     
    Methods inherited from interface javax.servlet.jsp.tagext.Tag
    getParent, setPageContext, setParent
     

    Field Detail

    attributeName

    protected java.lang.String attributeName
    Name of attribute to put in component context


    value

    private java.lang.Object value
    associated attribute value


    direct

    private java.lang.String direct
    JSP Template compatibility


    valueType

    private java.lang.String valueType
    Requested type for the value


    beanName

    private java.lang.String beanName
    Bean name attribute


    beanProperty

    private java.lang.String beanProperty
    Bean property attribute


    beanScope

    private java.lang.String beanScope
    Bean scope attribute


    role

    private java.lang.String role
    Role attribute


    realValue

    protected java.lang.Object realValue
    cached real value computed from tag attributes

    Constructor Detail

    PutTag

    public PutTag()
    default constructor

    Method Detail

    release

    public void release()
    Release all allocated resources.

    Specified by:
    release in interface javax.servlet.jsp.tagext.Tag
    Overrides:
    release in class javax.servlet.jsp.tagext.BodyTagSupport

    releaseInternal

    protected void releaseInternal()
    Release internal properties.


    setName

    public void setName(java.lang.String value)
    Set property


    getName

    public java.lang.String getName()
    Set property


    setValue

    public void setValue(java.lang.String value)
    Set property. Method added to satisfy Tomcat (bug ?)


    getValue

    public java.lang.String getValue()
    Set property. Method added to satisfy Tomcat (bug ?)


    setValue

    public void setValue(java.lang.Object value)
    Set property


    setObjectValue

    public void setObjectValue(java.lang.Object value)
    Set property value as an object Added because some web container react badly to value as Object.


    setContent

    public void setContent(java.lang.String value)
    Set property Method added to satisfy Tomcat (bug ?)


    getContent

    public java.lang.String getContent()
    Get property Method added to satisfy Tomcat (bug ?)


    setContent

    public void setContent(java.lang.Object value)
    Set property


    setDirect

    public void setDirect(java.lang.String isDirect)
    Set property Method added for compatibility with JSP1.1


    setType

    public void setType(java.lang.String value)
    Set property


    getType

    public java.lang.String getType()
    Get property


    setBeanName

    public void setBeanName(java.lang.String value)
    Set property.


    getBeanName

    public java.lang.String getBeanName()
    Get property.


    setBeanProperty

    public void setBeanProperty(java.lang.String value)
    Set property.


    getBeanProperty

    public java.lang.String getBeanProperty()
    Get property.


    setBeanScope

    public void setBeanScope(java.lang.String value)
    Set property.


    getBeanScope

    public java.lang.String getBeanScope()
    Get property.


    setRole

    public void setRole(java.lang.String role)
    Set role attribute


    getRole

    public java.lang.String getRole()
    Get role attribute

    Returns:
    The role defined in the tag or null.

    getRealValue

    public java.lang.Object getRealValue()
                                  throws javax.servlet.jsp.JspException
    Get real value according to tag attribute. Real value is the value compute after attribute processing :

    Returns:
    real value.
    Throws:
    javax.servlet.jsp.JspTagException - If something goes wrong while getting value from bean.
    javax.servlet.jsp.JspException

    computeRealValue

    protected void computeRealValue()
                             throws javax.servlet.jsp.JspException
    Compute real value according to tag attributes.

    Throws:
    javax.servlet.jsp.JspTagException - If something goes wrong while getting value from bean.
    javax.servlet.jsp.JspException

    getRealValueFromBean

    protected void getRealValueFromBean()
                                 throws javax.servlet.jsp.JspException
    Extract real value from specified bean.

    Throws:
    javax.servlet.jsp.JspTagException - If something goes wrong while getting value from bean.
    javax.servlet.jsp.JspException

    doStartTag

    public int doStartTag()
                   throws javax.servlet.jsp.JspException
    Do start tag

    Specified by:
    doStartTag in interface javax.servlet.jsp.tagext.Tag
    Overrides:
    doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
    javax.servlet.jsp.JspException

    doEndTag

    public int doEndTag()
                 throws javax.servlet.jsp.JspException
    Do end tag

    Specified by:
    doEndTag in interface javax.servlet.jsp.tagext.Tag
    Overrides:
    doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
    javax.servlet.jsp.JspException

    callParent

    protected void callParent()
                       throws javax.servlet.jsp.JspException
    Find parent tag which must implements AttributeContainer.

    Throws:
    javax.servlet.jsp.JspException - If we can't find an appropriate enclosing tag.

    findEnclosingPutTagParent

    protected PutTagParent findEnclosingPutTagParent()
                                              throws javax.servlet.jsp.JspException
    Find parent tag which must implements AttributeContainer.

    Throws:
    javax.servlet.jsp.JspException - If we can't find an appropriate enclosing tag.


    Copyright 2000-2002 - Cedric Dumoulin and Apache Software Foundation