tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenneth Eschrich <keschr...@graphlogic.com>
Subject Ignore attribute of insertAttribute not working?
Date Wed, 20 Aug 2008 19:42:57 GMT
Using Tiles 2.1.0 (beta?)

I have a tile template.jsp, which then inserts other tiles, header.jsp, 
footer.jsp, content definition, and side-menu definition. The two 
definitions vary with the page being loaded. Everything works great for 
the most part, except for one page which does not have a side-menu. When 
going to this page I got an exception stating that "Attribute 
'side-menu' not found".

Of course I could just create a copy of template.jsp which does not 
include the side-menu, but looking at the documentation I found there is 
an "ignore" attribute of insertAttribute which "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." So I changed the relevant line 
in template.jsp to <tiles:insertAttribute name="side-menu" ignore="true" />

Now, when I go to this particular page I do not get the exception from 
before, but rather this: "org.apache.tiles.impl.CannotRenderException: 
Cannot render a null attribute"

Any thoughts what could be going on here?


View raw message