org.apache.struts.tiles.taglib
Class PutTag

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

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.

    See Also:
    Serialized Form

    Field Summary
    protected  String attributeName
              Name of attribute to put in component context.
    protected  String body
              The body content of this tag.
    protected  Object realValue
              Cached real value computed from tag attributes.
     
    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.tiles.taglib.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 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.
     
    Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
    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.Tag
    getParent, setPageContext, setParent
     

    Field Detail

    attributeName

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


    realValue

    protected Object realValue
    Cached real value computed from tag attributes.


    body

    protected String body
    The body content of this tag.

    Constructor Detail

    PutTag

    public PutTag()
    Default constructor.

    Method Detail

    release

    public void release()
    Release all allocated resources.

    Specified by:
    release in interface Tag
    Overrides:
    release in class BodyTagSupport

    releaseInternal

    protected void releaseInternal()
    Release internal properties.


    setName

    public void setName(String value)
    Set name.


    getName

    public String getName()
    Get name.


    setValue

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


    getValue

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


    setValue

    public void setValue(Object value)
    Set value.


    setObjectValue

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


    setContent

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


    getContent

    public String getContent()
    Get 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.


    setType

    public void setType(String value)
    Set type.


    getType

    public String getType()
    Get type.


    setBeanName

    public void setBeanName(String value)
    Set bean name.


    getBeanName

    public String getBeanName()
    Get bean name.


    setBeanProperty

    public void setBeanProperty(String value)
    Set bean property.


    getBeanProperty

    public String getBeanProperty()
    Get bean property.


    setBeanScope

    public void setBeanScope(String value)
    Set bean scope.


    getBeanScope

    public String getBeanScope()
    Get bean scope.


    setRole

    public void setRole(String role)
    Set role attribute.

    Parameters:
    role - The role the user must be in to store content.

    getRole

    public String getRole()
    Get role attribute

    Returns:
    The role defined in the tag or null.

    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.
    Throws:
    JspException - If something goes wrong while getting value from bean.

    computeRealValue

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

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

    getRealValueFromBean

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

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

    doStartTag

    public int doStartTag()
                   throws JspException
    Do start tag.

    Specified by:
    doStartTag in interface Tag
    Overrides:
    doStartTag in class BodyTagSupport
    Throws:
    JspException

    doAfterBody

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

    Specified by:
    doAfterBody in interface IterationTag
    Overrides:
    doAfterBody in class BodyTagSupport
    Throws:
    JspException - if a JSP exception has occurred

    doEndTag

    public int doEndTag()
                 throws JspException
    Do end tag.

    Specified by:
    doEndTag in interface Tag
    Overrides:
    doEndTag in class BodyTagSupport
    Throws:
    JspException

    callParent

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

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

    findEnclosingPutTagParent

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

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


    Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.