problem with multiple tiles configuration files

This is an interesting problem for this newbie. I have one common tiles configuration file tiles.xml. I decided to split it into pieces based on modules. The syntax allows me to do it. the web.xml entry changed from

<context-param>
 <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
 <param-value>/WEB-INF/tiles.xml</param-value>
 </context-param>

to

<context-param>
 <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
 <param-value>/WEB-INF/tiles-license.xml,/WEB-INF/tiles-common.xml</param-value>
 </context-param>

Fortunately/Unfortunately, I declared all my basic templates in tiles-common.xml which is reused by tiles-license.xml. Pathetic. I ended up with annoying exception

org.apache.tiles.definition.NoSuchDefinitionException: licenseExpiryList
    org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:578)
    org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:246)
    org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
    org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)

We need to specify the tiles config files in ‘correct’ order. base definitions at first, children at the last.

Ref: http://old.nabble.com/How-can-I-separate-tiles.xml-in-several-files—td13216254.html

org.apache.tiles.definition.NoSuchDefinitionException: licenseExpiryList
	org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:578)
	org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:246)
	org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
	org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s