tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cal" <cal...@holview.com>
Subject RE: Ignore attribute of insertAttribute not working?
Date Wed, 20 Aug 2008 20:55:10 GMT
I just gave the insertAttribute with ignore a try and it did not get an
error - I am using 2.0.6.  What does your template look like?  Is the
insertAttribute included in another tag?

Cal
www.calandva.com 

-----Original Message-----
From: users-return-748-calvin=holview.com@tiles.apache.org
[mailto:users-return-748-calvin=holview.com@tiles.apache.org] On Behalf Of
Kenneth Eschrich
Sent: Wednesday, August 20, 2008 3:43 PM
To: users@tiles.apache.org
Subject: Ignore attribute of insertAttribute not working?

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?

Thanks,
Ken


Mime
View raw message