You can disable this option by writing your own DefinitionFactory
implementation and registering the same in TilesConfigurer
.
public class CustomLocaleDefinitionsFactory extends LocaleDefinitionsFactory {
/** {@inheritDoc} */
@Override
public Definition getDefinition(String name, Request tilesContext) {
Definition retValue;
Locale locale = null;
retValue = definitionDao.getDefinition(name, locale);
if (retValue != null) {
retValue = new Definition(retValue);
String parentDefinitionName = retValue.getExtends();
while (parentDefinitionName != null) {
Definition parent = definitionDao.getDefinition(parentDefinitionName, locale);
if (parent == null) {
throw new NoSuchDefinitionException("Cannot find definition '" + parentDefinitionName
+ "' ancestor of '" + retValue.getName() + "'");
}
retValue.inherit(parent);
parentDefinitionName = parent.getExtends();
}
}
return retValue;
}
}
And then in register the above definition factor class, in TilesConfigurer
in case using spring like this.
TilesConfigurer configurer = new TilesConfigurer();
configurer.setDefinitions(new String[] { "/WEB-INF/layouts/tiles.xml",
"/WEB-INF/views/**/tiles.xml" });
configurer.setCheckRefresh(true);
configurer.setDefinitionsFactoryClass(CustomLocaleDefinitionsFactory.class);
return configurer;