`
lerluc
  • 浏览: 16627 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

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:
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 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
  • tiles-jsp-2.1.3.jar (53.9 KB)
  • 描述: patched & compiled with jdk1.6. mind the version!
  • 下载次数: 3
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics