This tag library provides Tiles tags.

]]>
1.2 tiles http://tiles.apache.org/tags-tiles Insert a template.

Insert a template with the possibility to pass parameters (called attributes). A template can be seen as a procedure that can take parameters or attributes. <tiles:insertTemplate> allows to define these attributes and pass them to the inserted jsp page, called template. Attributes are defined using nested tag <tiles:putAttribute> or <tiles:putListAttribute>.

You must specify template attribute, for inserting a template

Example :

        
          <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
             <tiles:putAttribute name="title" value="My first page" />
             <tiles:putAttribute name="header" value="/common/header.jsp" />
             <tiles:putAttribute name="footer" value="/common/footer.jsp" />
             <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
             <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
          </tiles:insertTemplate>
        
      
]]>
insertTemplate org.apache.tiles.jsp.taglib.InsertTemplateTag scriptless A string representing the URI of a template (for example, a JSP page).

]]>
template true true
The type of the template attribute.

]]>
templateType false true java.lang.String
The expression to evaluate to get the value of the template.

If used together with template, this attribute will be ignored.

]]>
templateExpression false false java.lang.String
True or false. If true, current page out stream is flushed after insertion.

]]>
flush false false boolean
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
The fully qualified class name of the preparer. preparer false true
Insert a definition.

Insert a definition with the possibility to override and specify parameters (called attributes). A definition can be seen as a (partially or totally) filled template that can override or complete attribute values. <tiles:insertDefinition> allows to define these attributes and pass them to the inserted jsp page, called template. Attributes are defined using nested tag <tiles:putAttribute> or <tiles:putListAttribute>.

You must specify name tag attribute, for inserting a definition from definitions factory.

Example :

        
          <tiles:insertDefinition name=".my.tiles.defininition flush="true">
             <tiles:putAttribute name="title" value="My first page" />
             <tiles:putAttribute name="header" value="/common/header.jsp" />
             <tiles:putAttribute name="footer" value="/common/footer.jsp" />
             <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
             <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
          </tiles:insertDefinition>
        
      
]]>
insertDefinition org.apache.tiles.jsp.taglib.InsertDefinitionTag scriptless Name of the definition to insert.

]]>
name true true
A string representing the URI of a template (for example, a JSP page) that will override the one used by the definition itself.

]]>
template false true
The type of the template attribute.

]]>
templateType false true java.lang.String
The expression to evaluate to get the value of the template.

If used together with template, this attribute will be ignored.

]]>
templateExpression false false java.lang.String
True or false. If true, current page out stream is flushed after insertion.

]]>
flush false false boolean
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
The fully qualified class name of preparer. preparer false true
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 :

        
          <tiles:insertAttribute name="body" />
        
      
]]>
insertAttribute org.apache.tiles.jsp.taglib.InsertAttributeTag scriptless Name of the attribute to insert. This attribute will be ignored if the value attribute is specified.

]]>
name false true
Attribute object to render directly. If it specified, the name attribute will be ignored.

]]>
value false true java.lang.Object
True or false. If true, current page out stream is flushed after insertion.

]]>
flush false false boolean
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
The fully qualified name of the preparer. preparer false true This value is evaluated only if value is null and the attribute with the associated name is null.

]]>
defaultValue false true java.lang.Object
The type of the defaultValue, if it is a string. To be used in conjunction with defaultValue attribute.

]]>
defaultValueType false true java.lang.Object
The role to check for the default value. If the user is in the specified role, the default value is taken into account; otherwise, it is ignored (skipped). To be used in conjunction with defaultValue attribute.

]]>
defaultValueRole false true java.lang.Object
Create a definition at runtime.

Create a new definition at runtime. Newly created definition will be available across the entire request.

]]>
definition org.apache.tiles.jsp.taglib.definition.DefinitionTag scriptless Specifies the name under which the newly created definition bean will be saved.

]]>
name false true
A string representing the URI of a template (a JSP page).

]]>
template false true
Role to check before inserting this definition. If role is not defined for current user, definition is not inserted. Checking is done at insert time, not during definition process.

]]>
role false true
Name of a parent definition that is used to initialize this new definition. Parent definition is searched in definitions factory.

]]>
extends false true
Specifies the preparer name to use. The specified preparer will be executed before rendering this newly created definition.

]]>
preparer false true
Put an attribute in enclosing attribute container tag.

Enclosing attribute container tag can be :

  • <initContainer>
  • <definition>
  • <insertAttribute>
  • <insertDefinition>
  • <putListAttribute>
(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. 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.

]]>
putAttribute org.apache.tiles.jsp.taglib.PutAttributeTag scriptless Name of the attribute.

]]>
name true true
Attribute value. Could be a String or an Object.

]]>
value false true java.lang.Object
The expression to calculate the value from. Use this parameter, or value, or body.

]]>
expression false false java.lang.String
Specify content type: string, template or definition.

  • string : Content is printed directly.
  • template : Content is included from specified URL. Value is used as an URL.
  • definition : Value is the name of a definition defined in factory (xml file). Definition will be searched in the inserted tile, in a <tiles:insertAttribute name="attributeName"> tag, where 'attributeName' is the name used for this tag.
  • object: the value is used as it is.
]]>
type false false
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
If true, the attribute value will be cascaded to nested templates and definitions.

]]>
cascade false false boolean
Declare a list that will be pass as attribute to tile.

Declare a list that will be pass as attribute to tile. List elements are added using the tags 'addAttribute' or 'addListAttribute'. This tag can only be used inside 'insertTemplate', 'insertDefinition', 'definition' tags.

]]>
putListAttribute org.apache.tiles.jsp.taglib.PutListAttributeTag scriptless Name of the list.

]]>
name true true
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
If true, the attribute value will be cascaded to nested templates and definitions.

]]>
cascade false false boolean
If true, the attribute will put the elements of the attribute with the same name of the parent definition before the ones specified here. By default, it is 'false'.

]]>
inherit false false boolean
Add an element to the surrounding list. Equivalent to 'putAttribute', but for list element.

Add an element to the surrounding list. This tag can only be used inside 'putListAttribute' or 'addListAttribute' tags. Value can come from a direct assignment (value="aValue")

]]>
addAttribute org.apache.tiles.jsp.taglib.AddAttributeTag scriptless Attribute value. Can be a String or Object.

]]>
value false true java.lang.Object
The expression to calculate the value from. Use this parameter, or value, or body.

]]>
expression false false java.lang.String
Specify content type: string, template or definition.

  • string : Content is printed directly.
  • template : Content is included from specified URL. Value is used as an URL.
  • definition : Value denote a definition defined in factory (xml file). Definition will be searched in the inserted tile, in a <insertAttribute name="attributeName"> tag, where 'attributeName' is the name used for this tag.
  • object: the value is used as it is.
]]>
type false false
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
Declare a list that will be pass as an attribute.

Declare a list that will be pass as an attribute . List elements are added using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used inside 'insertTemplate', 'insertDefinition' or 'definition' tag.

]]>
addListAttribute org.apache.tiles.jsp.taglib.AddListAttributeTag scriptless If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
Render the value of the specified template attribute to the current JspWriter

Retrieve the value of the specified template attribute property, and render it to the current JspWriter as a String. The usual toString() conversions is applied on found value.

Throw a JSPException if named value is not found.

]]>
getAsString org.apache.tiles.jsp.taglib.GetAsStringTag empty Attribute name.

]]>
name true true
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
True or false. If true, current page out stream is flushed after insertion.

]]>
flush false false boolean
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

]]>
role false true
Use attribute value inside page.

Declare a Java variable, and an attribute in the specified scope, using its attribute value.

Java variable and attribute will have the name specified by 'id', or the original name if not specified.

]]>
useAttribute org.apache.tiles.jsp.taglib.UseAttributeTag org.apache.tiles.jsp.taglib.UseAttributeTag$Tei empty Declared attribute and variable name.

]]>
id false true
Class of the declared variable.

]]>
classname false true
Scope of the declared attribute. Default to 'page'.

]]>
scope false false
Attribute name.

]]>
name true true
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without error. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
Import attribute(s) in specified context.

Import attribute(s) to requested scope. Attribute name and scope are optional. If not specified, all attributes are imported in page scope. Once imported, an attribute can be used as any other beans from jsp contexts.

]]>
importAttribute org.apache.tiles.jsp.taglib.ImportAttributeTag empty Attribute name. If not specified, all attributes are imported.

]]>
name false true
Name of the destination bean. If not specified, the name will be the same as specified in name attribute

]]>
toName false true
Scope into which attribute is imported. Default to page.

]]>
scope false false
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without error. The default value is false, which will cause a runtime exception to be thrown.

]]>
ignore false true boolean
THIS TAG HAS BEEN DEPRECATED! Please use TilesInitializer or a servlet-based way, like TilesServlet, for initialization!

Initialize the TilesContainer.

In order to use the Tiles system, a TilesContainer must be instantiated. This initialization is generally done by the TilesListener (or perhaps the TilesServlet or TilesFilter).

If the intialization needs to be dynamic, you can initialize the container using this tag. Realize however, that this tag MUST be executed prior to invoking any other definitions. Additionally, the initilization may only be done once, and any subsequent invocations will be ignored.

]]>
initContainer org.apache.tiles.jsp.taglib.definition.InitContainerTag scriptless Container Factory implementation used to instantiate the container.

]]>
containerFactory false true
The key under which the container will be stored.

If not defined, the container will be the default container

]]>
containerKey false true
Destroy the TilesContainer.

]]>
destroyContainer org.apache.tiles.jsp.taglib.definition.DestroyContainerTag empty The key of the container to destroy.

If not defined, the destroyed container will be the default container

]]>
containerKey false true
Sets the current Tiles container to use in Tiles tags.

]]>
setCurrentContainer org.apache.tiles.jsp.taglib.definition.SetCurrentContainerTag empty The key of the container that will be set as "current".

If not defined, the current container will be the default container

]]>
containerKey false true