Package org.apache.tiles.template
Class InsertAttributeModel
- java.lang.Object
-
- org.apache.tiles.template.InsertAttributeModel
-
public class InsertAttributeModel extends java.lang.Object
Inserts the value of an attribute into the page.
This tag can be flexibly used to insert the value of an attribute into a page. As in other usages in Tiles, every attribute can be determined to have a "type", either set explicitly when it was defined, or "computed". If the type is not explicit, then if the attribute value is a valid definition, it will be inserted as such. Otherwise, if it begins with a "/" character, it will be treated as a "template". Finally, if it has not otherwise been assigned a type, it will be treated as a String and included without any special handling.
Example :
<code> <tiles:insertAttribute name="body" /> </code>
- Since:
- 2.2.0
- Version:
- $Rev: 1305937 $ $Date: 2012-03-28 05:15:15 +1100 (Wed, 28 Mar 2012) $
-
-
Constructor Summary
Constructors Constructor Description InsertAttributeModel()
Constructor that uses the defaut attribute resolver.InsertAttributeModel(AttributeResolver attributeResolver)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(boolean ignore, java.lang.String preparer, java.lang.String role, java.lang.Object defaultValue, java.lang.String defaultValueRole, java.lang.String defaultValueType, java.lang.String name, Attribute value, boolean flush, org.apache.tiles.request.Request request, org.apache.tiles.autotag.core.runtime.ModelBody modelBody)
Executes the operation.
-
-
-
Constructor Detail
-
InsertAttributeModel
public InsertAttributeModel()
Constructor that uses the defaut attribute resolver.- Since:
- 3.0.0
-
InsertAttributeModel
public InsertAttributeModel(AttributeResolver attributeResolver)
Constructor.- Parameters:
attributeResolver
- The attribute resolver to use.- Since:
- 2.2.0
-
-
Method Detail
-
execute
public void execute(boolean ignore, java.lang.String preparer, java.lang.String role, java.lang.Object defaultValue, java.lang.String defaultValueRole, java.lang.String defaultValueType, java.lang.String name, Attribute value, boolean flush, org.apache.tiles.request.Request request, org.apache.tiles.autotag.core.runtime.ModelBody modelBody) throws java.io.IOException
Executes the operation.- Parameters:
ignore
- Iftrue
, if an exception happens during rendering, of if the attribute is null, the problem will be ignored.preparer
- The preparer to invoke before rendering the attribute.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.defaultValue
- The default value of the attribute. To use only if the attribute was not computed.defaultValueRole
- The default comma-separated list of roles. To use only if the attribute was not computed.defaultValueType
- The default type of the attribute. To use only if the attribute was not computed.name
- The name of the attribute.value
- The attribute to use immediately, if not null.flush
- Iftrue
, the response will be flushed after the insert.request
- The request.modelBody
- The body.- Throws:
java.io.IOException
- If an I/O error happens during rendering.- Since:
- 2.2.0
-
-