org.apache.tiles.jsp.taglib
Class PutAttributeTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.tiles.jsp.taglib.TilesBodyTag
org.apache.tiles.jsp.taglib.AddAttributeTag
org.apache.tiles.jsp.taglib.PutAttributeTag
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, DefinitionTagParent
- Direct Known Subclasses:
- PutListAttributeTag
public class PutAttributeTag
- extends AddAttributeTag
Put an attribute in enclosing attribute container tag.
Enclosing attribute container tag can be :
- <initContainer>
- <definition>
- <insertAttribute>
- <insertDefinition>
- <putList>
(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 :
- name : Name of the attribute
- value : value to put as attribute
- type : value type. Only valid if value is a String and is set by
value="something" or by a bean.
Possible type are : string (value is used as direct string),
template (value is used as a page url to insert),
definition (value is used as a definition name to insert)
- direct : Specify if value is to be used as a direct string or as a
page url to insert. This is another way to specify the type. It only apply
if value is set as a string, and type is not present.
- beanName : Name of a bean used for setting value. Only valid if value is not set.
If property is specified, value come from bean's property. Otherwise, bean
itself is used for value.
- beanProperty : Name of the property used for retrieving value.
- beanScope : Scope containing bean.
- role : Role to check when 'insert' will be called. If enclosing tag is
<insert>, role is checked immediately. If enclosing tag is
<definition>, role will be checked when this definition will be
inserted.
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: 739526 $ $Date: 2009-01-31 09:50:58 +0100 (sab, 31 gen 2009) $
- See Also:
- Serialized Form
Field Summary |
protected String |
name
Name of attribute to put in attribute context. |
Method Summary |
protected void |
execute()
Executes the processing of this tag, calling its parent tag. |
String |
getName()
Returns the name of the attribute. |
boolean |
isCascade()
Checks if the attribute should be cascaded to nested definitions. |
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 |
setCascade(boolean cascade)
Sets the property that tells if the attribute should be cascaded to
nested definitions. |
void |
setName(String name)
Sets the name of the attribute. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected String name
- Name of attribute to put in attribute context.
PutAttributeTag
public PutAttributeTag()
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.
isCascade
public boolean isCascade()
- Checks if the attribute should be cascaded to nested definitions.
- Returns:
true
if the attribute will be cascaded.- Since:
- 2.1.0
setCascade
public void setCascade(boolean cascade)
- Sets the property that tells if the attribute should be cascaded to
nested definitions.
- Parameters:
cascade
- true
if the attribute will be cascaded.- Since:
- 2.1.0
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 AddAttributeTag
execute
protected void execute()
throws TilesJspException
- Executes the processing of this tag, calling its parent tag.
- Overrides:
execute
in class AddAttributeTag
- Throws:
TilesJspException
- If something goes wrong during execution.
Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.