org.apache.struts.taglib.tiles

Class PutTag

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 StringattributeName
    Name of attribute to put in component context.
    StringbeanName
    Bean name attribute.
    StringbeanProperty
    Bean property attribute.
    StringbeanScope
    Bean scope attribute.
    protected Stringbody
    The body content of this tag.
    Stringdirect
    JSP Template compatibility.
    protected ObjectrealValue
    Cached real value computed from tag attributes.
    Stringrole
    Role attribute.
    Objectvalue
    Associated attribute value.
    StringvalueType
    Requested type for the value.
    Constructor Summary
    PutTag()
    Default constructor.
    Method Summary
    protected voidcallParent()
    Find parent tag which must implement AttributeContainer.
    protected voidcomputeRealValue()
    Compute real value according to tag attributes.
    intdoAfterBody()
    Save the body content of this tag (if any)
    intdoEndTag()
    Do end tag.
    intdoStartTag()
    Do start tag.
    protected PutTagParentfindEnclosingPutTagParent()
    Find parent tag which must implement AttributeContainer.
    StringgetBeanName()
    Get bean name.
    StringgetBeanProperty()
    Get bean property.
    StringgetBeanScope()
    Get bean scope.
    StringgetContent()
    Get content.
    StringgetName()
    Get name.
    ObjectgetRealValue()
    Get real value according to tag attribute.
    protected voidgetRealValueFromBean()
    Extract real value from specified bean.
    StringgetRole()
    Get role attribute
    StringgetType()
    Get type.
    StringgetValue()
    Get value.
    voidrelease()
    Release all allocated resources.
    protected voidreleaseInternal()
    Release internal properties.
    voidsetBeanName(String value)
    Set bean name.
    voidsetBeanProperty(String value)
    Set bean property.
    voidsetBeanScope(String value)
    Set bean scope.
    voidsetContent(String value)
    Set content.
    voidsetContent(Object value)
    Set content.
    voidsetDirect(String isDirect)
    Set direct.
    voidsetName(String value)
    Set name.
    voidsetObjectValue(Object value)
    Set property value as an object.
    voidsetRole(String role)
    Set role attribute.
    voidsetType(String value)
    Set type.
    voidsetValue(String value)
    Set value.
    voidsetValue(Object value)
    Set value.

    Field Detail

    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 Detail

    PutTag

    public PutTag()
    Default constructor.

    Method Detail

    callParent

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

    Throws: JspException If we can't find an appropriate enclosing tag.

    computeRealValue

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

    Throws: JspException If something goes wrong while getting value from bean.

    doAfterBody

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

    Throws: JspException if a JSP exception has occurred

    doEndTag

    public int doEndTag()
    Do end tag.

    doStartTag

    public int doStartTag()
    Do start tag.

    findEnclosingPutTagParent

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

    Throws: JspException If we can't find an appropriate enclosing tag.

    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()
    Get real value according to tag attribute. Real value is the value computed after attribute processing.

    Returns: Real value.

    Throws: JspException If something goes wrong while getting value from bean.

    getRealValueFromBean

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

    Throws: JspException If something goes wrong while getting value from 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(String value)
    Set content. Method added to satisfy Tomcat (bug ?).

    setContent

    public void setContent(Object value)
    Set content.

    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(String value)
    Set value. Method added to satisfy Tomcat (bug ?).

    setValue

    public void setValue(Object value)
    Set value.
    Copyright B) 2000-2007 - The Apache Software Foundation