tiles 2.1.3 bug: 'ignore' doesn't work for insertDefinition tag
<tiles:insertDefinition name="def" ignore="true"/>
Description: "If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown."
But in fact, when "def" isn't configured it throws exception regardless of ignore="true".
Workaround:
- download src of tiles-2.1.3
- tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertDefinitionTag.java line 65: (patched)
protected void renderContext() {
boolean isValid = container.isValidDefinition(name, pageContext);
if(isValid || !ignore)
container.render(name, pageContext);
}
- compile a tiles-jsp.jar and replace the original one or use this one (compiled with jdk1.6. mind the version!)
Another bug with "ignore" for insertAttribute tag
<tiles:insertAttribute name="attr" ignore="true"/>
refer to JIRA for the patch