org.apache.struts.taglib.tiles

Class PutTag

Implemented Interfaces:
ComponentConstants
Known Direct Subclasses:
AddTag

public class PutTag
extends 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.

    Field Summary

    protected String
    attributeName
    Name of attribute to put in component context.
    private String
    beanName
    Bean name attribute.
    private String
    beanProperty
    Bean property attribute.
    private String
    beanScope
    Bean scope attribute.
    protected String
    body
    The body content of this tag.
    private String
    direct
    JSP Template compatibility.
    protected Object
    realValue
    Cached real value computed from tag attributes.
    private String
    role
    Role attribute.
    private Object
    value
    Associated attribute value.
    private String
    valueType
    Requested type for the value.

    Fields inherited from interface org.apache.struts.taglib.tiles.ComponentConstants

    COMPONENT_CONTEXT, COMPONENT_SCOPE, EXCEPTION_KEY, LOCALE_KEY

    Constructor Summary

    PutTag()
    Default constructor.

    Method Summary

    protected void
    callParent()
    Find parent tag which must implement AttributeContainer.
    protected void
    computeRealValue()
    Compute real value according to tag attributes.
    int
    doAfterBody()
    Save the body content of this tag (if any)
    int
    doEndTag()
    Do end tag.
    int
    doStartTag()
    Do start tag.
    protected PutTagParent
    findEnclosingPutTagParent()
    Find parent tag which must implement AttributeContainer.
    String
    getBeanName()
    Get bean name.
    String
    getBeanProperty()
    Get bean property.
    String
    getBeanScope()
    Get bean scope.
    String
    getContent()
    Get content.
    String
    getName()
    Get name.
    Object
    getRealValue()
    Get real value according to tag attribute.
    protected void
    getRealValueFromBean()
    Extract real value from specified bean.
    String
    getRole()
    Get role attribute
    String
    getType()
    Get type.
    String
    getValue()
    Get value.
    void
    release()
    Release all allocated resources.
    protected void
    releaseInternal()
    Release internal properties.
    void
    setBeanName(String value)
    Set bean name.
    void
    setBeanProperty(String value)
    Set bean property.
    void
    setBeanScope(String value)
    Set bean scope.
    void
    setContent(Object value)
    Set content.
    void
    setContent(String value)
    Set content.
    void
    setDirect(String isDirect)
    Set direct.
    void
    setName(String value)
    Set name.
    void
    setObjectValue(Object value)
    Set property value as an object.
    void
    setRole(String role)
    Set role attribute.
    void
    setType(String value)
    Set type.
    void
    setValue(Object value)
    Set value.
    void
    setValue(String value)
    Set value.

    Field Details

    attributeName

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

    beanName

    private String beanName
    Bean name attribute.

    beanProperty

    private String beanProperty
    Bean property attribute.

    beanScope

    private String beanScope
    Bean scope attribute.

    body

    protected String body
    The body content of this tag.

    direct

    private String direct
    JSP Template compatibility.

    realValue

    protected Object realValue
    Cached real value computed from tag attributes.

    role

    private String role
    Role attribute.

    value

    private Object value
    Associated attribute value.

    valueType

    private String valueType
    Requested type for the value.

    Constructor Details

    PutTag

    public PutTag()
    Default constructor.

    Method Details

    callParent

    protected void callParent()
                throws JspException
    Find parent tag which must implement AttributeContainer.

    computeRealValue

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

    doAfterBody

    public int doAfterBody()
                throws JspException
    Save the body content of this tag (if any)

    doEndTag

    public int doEndTag()
                throws JspException
    Do end tag.

    doStartTag

    public int doStartTag()
                throws JspException
    Do start tag.

    findEnclosingPutTagParent

    protected PutTagParent findEnclosingPutTagParent()
                throws JspException
    Find parent tag which must implement AttributeContainer.

    getBeanName

    public String getBeanName()
    Get bean name.

    getBeanProperty

    public String getBeanProperty()
    Get bean property.

    getBeanScope

    public String getBeanScope()
    Get bean scope.

    getContent

    public String getContent()
    Get content. Method added to satisfy Tomcat (bug ?).

    getName

    public String getName()
    Get name.

    getRealValue

    public Object getRealValue()
                throws JspException
    Get real value according to tag attribute. Real value is the value computed after attribute processing.
    Returns:
    Real value.

    getRealValueFromBean

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

    getRole

    public String getRole()
    Get role attribute
    Returns:
    The role defined in the tag or null.

    getType

    public String getType()
    Get type.

    getValue

    public String getValue()
    Get value. Method added to satisfy Tomcat (bug ?).

    release

    public void release()
    Release all allocated resources.

    releaseInternal

    protected void releaseInternal()
    Release internal properties.

    setBeanName

    public void setBeanName(String value)
    Set bean name.

    setBeanProperty

    public void setBeanProperty(String value)
    Set bean property.

    setBeanScope

    public void setBeanScope(String value)
    Set bean scope.

    setContent

    public void setContent(Object value)
    Set content.

    setContent

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

    setDirect

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

    setName

    public void setName(String value)
    Set name.

    setObjectValue

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

    setRole

    public void setRole(String role)
    Set role attribute.
    Parameters:
    role - The role the user must be in to store content.

    setType

    public void setType(String value)
    Set type.

    setValue

    public void setValue(Object value)
    Set value.

    setValue

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

    Copyright B) 2000-2007 - The Apache Software Foundation