Package org.apache.tiles.jsp.taglib
Class PutAttributeTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.SimpleTagSupport
-
- org.apache.tiles.jsp.taglib.PutAttributeTag
-
- All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.SimpleTag
public class PutAttributeTag extends javax.servlet.jsp.tagext.SimpleTagSupportPut an attribute in enclosing attribute container tag.
Enclosing attribute container tag can be :
- <initContainer>
- <definition>
- <insertAttribute>
- <insertDefinition>
- <putListAttribute>
PutAttributeTagParentinterface. 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. 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), object (value is used as it is)
- role : Role to check when 'insertAttribute' will be called.
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.
-
-
Constructor Summary
Constructors Constructor Description PutAttributeTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoTag()java.lang.StringgetExpression()Getter for expression property.java.lang.StringgetName()Getter for name property.java.lang.StringgetRole()Getter for role property.java.lang.StringgetType()Getter for type property.java.lang.ObjectgetValue()Getter for value property.booleanisCascade()Getter for cascade property.voidsetCascade(boolean cascade)Setter for cascade property.voidsetExpression(java.lang.String expression)Setter for expression property.voidsetName(java.lang.String name)Setter for name property.voidsetRole(java.lang.String role)Setter for role property.voidsetType(java.lang.String type)Setter for type property.voidsetValue(java.lang.Object value)Setter for value property.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Getter for name property.- Returns:
- The name of the attribute to put.
-
setName
public void setName(java.lang.String name)
Setter for name property.- Parameters:
name- The name of the attribute to put.
-
getValue
public java.lang.Object getValue()
Getter for value property.- Returns:
- The value of the attribute. Use this parameter, or expression, or body.
-
setValue
public void setValue(java.lang.Object value)
Setter for value property.- Parameters:
value- The value of the attribute. Use this parameter, or expression, or body.
-
getExpression
public java.lang.String getExpression()
Getter for expression property.- Returns:
- The expression to calculate the value from. Use this parameter, or value, or body.
-
setExpression
public void setExpression(java.lang.String expression)
Setter for expression property.- Parameters:
expression- The expression to calculate the value from. Use this parameter, or value, or body.
-
getRole
public java.lang.String getRole()
Getter for role property.- Returns:
- A comma-separated list of roles. If present, the attribute will be rendered only if the current user belongs to one of the roles.
-
setRole
public void setRole(java.lang.String role)
Setter for role property.- Parameters:
role- A comma-separated list of roles. If present, the attribute will be rendered only if the current user belongs to one of the roles.
-
getType
public java.lang.String getType()
Getter for type property.- Returns:
- The type (renderer) of the attribute.
-
setType
public void setType(java.lang.String type)
Setter for type property.- Parameters:
type- The type (renderer) of the attribute.
-
isCascade
public boolean isCascade()
Getter for cascade property.- Returns:
- If
truethe attribute will be cascaded to all nested attributes.
-
setCascade
public void setCascade(boolean cascade)
Setter for cascade property.- Parameters:
cascade- Iftruethe attribute will be cascaded to all nested attributes.
-
doTag
public void doTag() throws javax.servlet.jsp.JspException, java.io.IOException- Specified by:
doTagin interfacejavax.servlet.jsp.tagext.SimpleTag- Overrides:
doTagin classjavax.servlet.jsp.tagext.SimpleTagSupport- Throws:
javax.servlet.jsp.JspExceptionjava.io.IOException
-
-