File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Nest tiles don't work :( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Nest tiles don Watch "Nest tiles don New topic

Nest tiles don't work :(

Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102

This problem is quite hard to explain since it is the first time that I have encountered it. Basically I am trying to have tile reference from pages that are loaded using tiles as well.

I have a default.jsp page that is used as a template by all other pages. This default.jsp page has the following XTML:

In the tiles-def.xml file I have the following settings for the default definition.

Now I have the home.jsp page. In the tiles-defs.xml file I set the definition for home as follows:

This works fine, and the home page is loaded using with the header at top and footer at bottom. However I tried adding the a tile definition in the home page as follows:

I would expect that on the home page I get the title printed as well. However instead I get the following exception on screen:

Why is this happening? I do have the �title� attribute defined! Then why doesn�t it want to work?

Thanks for any comments,
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456

tiles does have an individual scope (tiles-scope). that means that you are unable to access attributes from inside a nested scope unless you save them explicitly.

take a look at the answer i gave in this thread, that's pretty much the constellation you need as well.

there is an "advanced tiles" pdf available which explains those details, should you be more interested...


hope it helps,
[ October 22, 2006: Message edited by: Jan Groth ]
Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Thank You very much

That was really helpfull

I agree. Here's the link:
subject: Nest tiles don't work :(
It's not a secret anymore!