[ https://issues.apache.org/jira/browse/TILES-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14335447#comment-14335447 ]
NZa commented on TILES-570: --------------------------- Did anyone check this? This ticket is still valid in in 3.0.5. Check here https://github.com/apache/tiles/blob/TILES_3_0_X/tiles-core/src/main/java/org/apache/tiles/factory/BasicTilesContainerFactory.java for the hard coded "/WEB-INF/tiles.xml" > Init via listeners and configuring DEFINITIONS_CONFIG via context-param does > not work as documented > --------------------------------------------------------------------------------------------------- > > Key: TILES-570 > URL: https://issues.apache.org/jira/browse/TILES-570 > Project: Tiles > Issue Type: Bug > Components: tiles-core, tiles-servlet > Affects Versions: 3.1.x, 3.0.1, 3.0.2 > Reporter: NZa > Labels: DEFINITIONS_CONFIG, config,, location,, tiles.xml, > > Please see http://tiles.apache.org/tutorial/configuration.html for some docs > and go to the section "Load the Tiles listener. Specify it in your web.xml > file". > Issue 1: > The following configuration is invalid because > org.apache.tiles.web.startup.TilesListener does not exist anymore: > <listener> > > <listener-class>org.apache.tiles.web.startup.TilesListener</listener-class> > </listener> > Issue 2: > Because of Issue 1 I have chosen to use the > org.apache.tiles.web.startup.simple.SimpleTilesListener for starting the > Tiles engine (see http://tiles.apache.org/framework/config-reference.html): > <listener> > > <listener-class>org.apache.tiles.web.startup.simple.SimpleTilesListener</listener-class> > </listener> > According to the docs this should be possible: > <context-param> > <param-name> > org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG > </param-name> > <param-value>/WEB-INF/classes/tiles.xml</param-value> > </context-param> > But org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG does not > exist (it was mentioned to be deprecated in older versions of Tiles!). > Issue 3: > Because of issue 2 I used > org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG: > <context-param> > <param-name> > org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG > </param-name> > <param-value>/WEB-INF/classes/tiles.xml</param-value> > </context-param> > But that does also not allow to load the custom tiles.xml file. > Issue 4: > I checked sources and found this in > org.apache.tiles.factory.BasicTilesContainerFactory (tiles-core-3.0.1.jar): > /** > * Returns a list containing the resources to be parsed. By default, it > returns a > * list containing the resource at "/WEB-INF/tiles.xml". > * @param applicationContext The Tiles application context. > * @return The resources. > * @since 2.1.1 > */ > protected List<ApplicationResource> getSources(ApplicationContext > applicationContext) { > List<ApplicationResource> retValue = new > ArrayList<ApplicationResource>(1); > retValue.add(applicationContext.getResource("/WEB-INF/tiles.xml")); > return retValue; > } > As you can see "/WEB-INF/tiles.xml" is hard coded. That's why using the > context-param has no influence at all. The only valid location is > "/WEB-INF/tiles.xml" and that's it. > Would be great if this would be fixed in one of the next releases. > Also see the docs here: > http://tiles.apache.org/config-reference.html#org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG -- This message was sent by Atlassian JIRA (v6.3.4#6332)