Antonio Petrelli a écrit :
2007/10/15, Baptiste GAILLARD <[EMAIL PROTECTED]>:
I begin to have a lot of tiles definitions in my WEB-INF/tiles.xml file,
is it possible to separate this files in multiple files ?

Sure, as long as you specify them in the correct configuration parameter:
http://tiles.apache.org/config-reference.html#org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG

Antonio

Ok, it seems to work, but now I want to define a definition which extends a definition specified in an other tiles.xml file.

In /WEB-INF/tiles.xml I have

<definition name="userDatatable" extends="datatable">
   <put-list-attribute name="attributesTiles">
       <item link="login" value="login" />
       <item link="firstName" value="first name" />
       <item link="lastName" value="last name" />
   </put-list-attribute>
</definition>

In /pages/components/datatable/tiles.xml I have :

<definition name="datatable" template="/pages/components/datatable/datatable.jsp">
   <put-list-attribute name="resultsByPageTiles">
       <add-attribute value="10" />
       <add-attribute value="25" />
       <add-attribute value="50" />
       <add-attribute value="100" />
       <add-attribute value="all" />
   </put-list-attribute>
</definition>

The following errors appears when I access to my page:
01:13:07,470 ERROR [DefinitionsImpl] Error while resolving definition inheritance: child 'userDatatable' can't find its ancestor 'datatable'. Please check your description file. 01:13:07,470 ERROR [RoleSecurityTagSupport] Error executing tag: Error while resolving definition inheritance: child 'userDatatable' can't find its ancestor 'datatable'. Please check your description file. org.apache.tiles.definition.NoSuchDefinitionException: Error while resolving definition inheritance: child 'userDatatable' can't find its ancestor 'datatable'. Please check your description file.

So I suppose I can't extend a definition which is defined in another tiles.xml file ? Is it possible to do that in tiles 2, is there an "include" makup like in struts config files ?

Thanks.

Baptiste

Reply via email to