Package org.apache.tiles.template
Class PutAttributeModel
- java.lang.Object
-
- org.apache.tiles.template.PutAttributeModel
-
public class PutAttributeModel extends java.lang.Object
Put an attribute in enclosing attribute container tag.
Enclosing attribute container tag can be :
- <initContainer>
- <definition>
- <insertAttribute>
- <insertDefinition>
- <putListAttribute>
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. 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.
- Since:
- 2.2.0
- Version:
- $Rev: 1305937 $ $Date: 2012-03-28 05:15:15 +1100 (Wed, 28 Mar 2012) $
-
-
Constructor Summary
Constructors Constructor Description PutAttributeModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.String name, java.lang.Object value, java.lang.String expression, java.lang.String role, java.lang.String type, boolean cascade, org.apache.tiles.request.Request request, org.apache.tiles.autotag.core.runtime.ModelBody modelBody)
Executes the operation.
-
-
-
Method Detail
-
execute
public void execute(java.lang.String name, java.lang.Object value, java.lang.String expression, java.lang.String role, java.lang.String type, boolean cascade, org.apache.tiles.request.Request request, org.apache.tiles.autotag.core.runtime.ModelBody modelBody) throws java.io.IOException
Executes the operation.- Parameters:
name
- The name of the attribute to put.value
- The value of the attribute. Use this parameter, or expression, or body.expression
- The expression to calculate the value from. Use this parameter, or value, or body.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.type
- The type (renderer) of the attribute.cascade
- Iftrue
the attribute will be cascaded to all nested attributes.request
- The request.modelBody
- The body.- Throws:
java.io.IOException
- If the body cannot be evaluated.- Since:
- 2.2.0
-
-