tiles 2.1.3 bug: 'ignore' doesn't work for insertDefinition tag

<tiles:insertDefinition name="def" ignore="true"/>

[size=large]Description[/size]: [b]"[/b]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.[b]"[/b]

[size=large]But in fact[/size], when "def" isn't configured [b]it throws exception regardless of ignore="true"[/b].

[size=large]Workaround[/size]:
1) download src of tiles-2.1.3
2) 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);
}

3) compile a tiles-jsp.jar and replace the original one
or use [url=http://dl.iteye.com/topics/download/da959ce1-695f-3a94-b1d7-549168543506]this one[/url] (compiled with jdk1.6. mind the version!)

[size=large]Another bug[/size] with "ignore" for insertAttribute tag
<tiles:insertAttribute name="attr" ignore="true"/>

refer to [url=http://issues.apache.org/struts/browse/TILES-441]JIRA[/url] for the patch
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值