Вы можете отключить эту опцию, написав свой собственный DefinitionFactory
осуществления и регистрации их в 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;
}
}
А затем в регистре выше определение фактора класса, в TilesConfigurer
в случае использования пружины, как это.
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;