You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Ignacio de Córdoba <ic...@skios.es> on 2009/01/26 19:32:14 UTC
Multiple tiles.xml and "can't find its ancestor" error
Hi there,
I am using Tiles2 with Struts2 (Tiles 2.1.1 and Struts 2.1.6) and it works
ok (I've been told I wouldn't work).
So far I am having just one problem and is extending a tile from another
tile present in a different configuration file.
I am using org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
parameter as I've read that the old conf. parameter is deprecated (anyway,
both show the same problem).
Anybody has gone through this issue? If I group all definitions in the same
xml file there is no problem.
Of course, I've tried sorting the xml files in the conf. parameter with all
combinations with no success.
Thanks,
Ignacio
--
View this message in context: http://www.nabble.com/Multiple-tiles.xml-and-%22can%27t-find-its-ancestor%22-error-tp21670877p21670877.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Multiple tiles.xml and "can't find its ancestor" error
Posted by Antonio Petrelli <an...@gmail.com>.
2009/1/28 Ignacio de Córdoba <ic...@skios.es>:
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
> </listener>
StrutsTilesListener, AFAIK, does not work with Tiles 2.1.x
> <param-value>/org/apache/tiles/classpath-defs.xml,/WEB-INF/tiles2-defs.xml
> </param-value>
If you have not a "classpath-defs.xml" why don't you remove it?
Moreover, please post the configuration that *does not work*, there is
no sense in helping with a working configuration :-D
Antonio
Re: Multiple tiles.xml and "can't find its ancestor" error
Posted by Ignacio de Córdoba <ic...@skios.es>.
Of course! :-)
Here is the code in web.xml:
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
</param-name>
<param-value>/org/apache/tiles/classpath-defs.xml,/WEB-INF/tiles2-defs.xml
</param-value>
</context-param>
(Now there is only that tiles2-defs.xml with everything on it. i've tried to
place there several files comma separated with no success, also placing
classpath-defs.xml first and lastone)
I am using the following entry in struts.xml to "activate" tiles2 in
struts2:
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"/>
thanks a lot for your help,
Ignacio
--
View this message in context: http://www.nabble.com/Multiple-tiles.xml-and-%22can%27t-find-its-ancestor%22-error-tp21670877p21697013.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Multiple tiles.xml and "can't find its ancestor" error
Posted by Antonio Petrelli <an...@gmail.com>.
2009/1/28 Ignacio de Córdoba <ic...@skios.es>:
> /WEB-INF/tiles2-common_defs.xml,/WEB-INF/tiles2-defs.xml
Try renaming the tiles2-common_defs.xml without using an underscore.
The underscore character is used to manage localization, e.g. using the name:
tiles-defs_it_IT.xml
defines a specialized version of tiles-defs.xml for Italian (in Italy).
Antonio
Re: Multiple tiles.xml and "can't find its ancestor" error
Posted by Ignacio de Córdoba <ic...@skios.es>.
Of course... it doesn't change mucho anyway...
<listener><!--Puede usarse un filtro
http://tiles.apache.org/tutorial/configuration.html -->
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
<param-name>
org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
</param-name>
<param-value>
/WEB-INF/tiles2-common_defs.xml,/WEB-INF/tiles2-defs.xml
</param-value>
</context-param>
tiles included in tiles2-common_defs.xml are not visible to tiles2-defs.xml
(or any other file). If I group all definitions in one file, it works.
Thanks again,
Ignacio
--
View this message in context: http://www.nabble.com/Multiple-tiles.xml-and-%22can%27t-find-its-ancestor%22-error-tp21670877p21703983.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Multiple tiles.xml and "can't find its ancestor" error
Posted by Antonio Petrelli <an...@gmail.com>.
2009/1/26 Ignacio de Córdoba <ic...@skios.es>:
>
> I am using Tiles2 with Struts2 (Tiles 2.1.1 and Struts 2.1.6) and it works
> ok (I've been told I wouldn't work).
It works if you use them separately :-) Only the Struts2/Tiles2 plugin
does not work with Tiles 2.1.x
> So far I am having just one problem and is extending a tile from another
> tile present in a different configuration file.
> I am using org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
> parameter as I've read that the old conf. parameter is deprecated (anyway,
> both show the same problem).
>
> Anybody has gone through this issue? If I group all definitions in the same
> xml file there is no problem.
May I see your web.xml and your Tiles definition files, and what is
the offending definition?
Antonio