tiles
Tag insert


Insert a tiles/component/template.

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

You must specify one of this tag attribute :

In fact, Page, component and template, are equivalent as a tile, component or template are jsp page.

Example :

  <tiles:insert page="/basic/myLayout.jsp" flush="true"> <tiles:put name="title" value="My first page" /> <tiles:put name="header" value="/common/header.jsp" /> <tiles:put name="footer" value="/common/footer.jsp" /> <tiles:put name="menu" value="/basic/menu.jsp" /> <tiles:put name="body" value="/basic/helloBody.jsp" /> </tiles:insert>  


Tag Information
Tag Classorg.apache.struts.tiles.taglib.InsertTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
templatefalsetruejava.lang.String

A string representing the URI of a tile or template (a JSP page).

'page', 'component' and 'template' are synonyms : they have exactly the same behavior.

componentfalsetruejava.lang.String

Path (relative or absolute to webapps) of the component to insert.

'page', 'component' and 'template' are synonyms : they have exactly the same behavior.

pagefalsetruejava.lang.String

Path (relative or absolute to webapps) of the page to insert.

'page', 'component' and 'template' are synonyms : they have exactly the same behavior.

definitionfalsetruejava.lang.String

Name of the definition to insert. Definition are defined in a centralized file. For now, only definition from factory can be inserted with this attribute. To insert a definition defined with tag <tiles:definition>, use beanName="".

attributefalsefalsejava.lang.String

Name of an attribute in current tile/component context. Value of this attribute is passed to 'name' (see attribute 'name').

namefalsetruejava.lang.String

Name of an entity to insert. Search is done in this order : definition, attribute, [tile/component/template/page].

beanNamefalsetruejava.lang.String

Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise, method pageContext.findAttribute is used. If beanProperty is also specified, retrieve value from the corresponding bean property.

If found bean (or property value) is instance of one of Attribute class (Direct, Instance, ...), insertion is done according to the class type. Otherwise, the toString method is called on the bean, and returned String is used as name to insert (see 'name' attribute).

beanPropertyfalsetruejava.lang.String

Bean property name. If specified, value is retrieve from this property. Support nested/indexed properties.

beanScopefalsefalsejava.lang.String

Scope into which bean is searched. If not specified, method pageContext.findAttribute is used. Scope can be any JSP scope, 'component', or 'template'. In these two later cases, bean is search in tile/component/template context.

flushfalsefalseboolean

True or false. If true, current page out stream is flushed before insertion.

ignorefalsetrueboolean

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.

rolefalsetruejava.lang.String

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

controllerUrlfalsetruejava.lang.String

Url of a controller called immediately before page is inserted.

Url usually denote a Struts action. Controller (action) is used to prepare data to be render by inserted Tile.

See also controlerClass. Only one of controllerUrl or controllerClass should be used.

controllerClassfalsetruejava.lang.String

Class type of a controller called immediately before page is inserted.

Controller is used to prepare data to be render by inserted Tile.

See also controlerUrl

Class must implements or extends one of the following :

  • org.apache.struts.tiles.Controller
  • org.apache.struts.tiles.ControllerSupport
  • org.apache.struts.action.Action (wrapper org.apache.struts.action.ActionController is used)

See also controllerUrl. Only one of controllerUrl or controllerClass should be used.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.