This project has retired. For details please refer to its Attic page.
PutAttributeTag (Tiles 2 2.0.7 API)

org.apache.tiles.jsp.taglib
Class PutAttributeTag

Package class diagram package PutAttributeTag
java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.tiles.jsp.taglib.TilesBodyTag
              extended by org.apache.tiles.jsp.taglib.RoleSecurityTagSupport
                  extended by org.apache.tiles.jsp.taglib.PutAttributeTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
PutListAttributeTag

public class PutAttributeTag
extends RoleSecurityTagSupport

Put an attribute in enclosing attribute container tag.

Enclosing attribute container tag can be :

(or any other tag which implements the PutAttributeTagParent interface. 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.

Version:
$Rev: 727715 $ $Date: 2008-12-18 14:06:06 +0100 (Thu, 18 Dec 2008) $
See Also:
Serialized Form

Field Summary
protected  String name
          Name of attribute to put in attribute context.
 
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 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
PutAttributeTag()
           
 
Method Summary
 int doAfterBody()
          Save the body content of this tag (if any).
protected  void execute()
          Executes the tag.
 String getName()
          Returns the name of the attribute.
 String getType()
           Returns the content type: string, template or definition.
 Object getValue()
          Returns the Attribute value.
protected  void reset()
          Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().
 void setName(String name)
          Sets the name of the attribute.
 void setType(String type)
           Sets the content type: string, template or definition.
 void setValue(Object value)
          Sets the Attribute value.
 
Methods inherited from class org.apache.tiles.jsp.taglib.RoleSecurityTagSupport
doEndTag, getRole, isAccessAllowed, setRole
 
Methods inherited from class org.apache.tiles.jsp.taglib.TilesBodyTag
doCatch, doFinally, release
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, doStartTag, 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

name

protected String name
Name of attribute to put in attribute context.

Constructor Detail

PutAttributeTag

public PutAttributeTag()
Method Detail

getName

public String getName()
Returns the name of the attribute.

Returns:
The name of the attribute.

setName

public void setName(String name)
Sets the name of the attribute.

Parameters:
name - The name of the attribute.

getValue

public Object getValue()
Returns the Attribute value. Could be a String or an Object. Value can come from a direct assignment (value="aValue") or from a bean. One of 'value' 'content' or 'beanName' must be present.

Returns:
The attribute value.

setValue

public void setValue(Object value)
Sets the Attribute value. Could be a String or an Object. Value can come from a direct assignment (value="aValue") or from a bean. One of 'value' 'content' or 'beanName' must be present.

Parameters:
value - The attribute value.

getType

public String getType()

Returns the content type: string, template or definition.

Returns:
The attribute type.

setType

public void setType(String type)

Sets the content type: string, template or definition.

Parameters:
type - The attribute type.

reset

protected void reset()
Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().

Overrides:
reset in class RoleSecurityTagSupport

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
Returns:
SKIP_BODY.
Throws:
JspException - if a JSP exception has occurred

execute

protected void execute()
                throws JspException
Executes the tag. It is called inside RoleSecurityTagSupport.doEndTag().

Specified by:
execute in class RoleSecurityTagSupport
Throws:
JspException - If something goes wrong during rendering.


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