File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Tiles put-list-attribute inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles put-list-attribute inheritance" Watch "Tiles put-list-attribute inheritance" New topic

Tiles put-list-attribute inheritance

Amit Goda
Ranch Hand

Joined: Jan 21, 2012
Posts: 37

Hello everyone,

I am using Tiles 2.1 and I am facing a problem regarding the put-list-attribute inheritance.
Following is my tiles-defs.xml

and following is how i am implementing Javascript and CSS on my baseLayout.jsp

The problem is when home definition is called, it overrides the default value of put-list-attribute, i.e when i view the Login page the style.css and jquery.js are applied to the page,
but when i redirect to the home page, the home definition's put-list-attribute overrides the baseLayout's put-list-attribute

so the home page contains SpryAssets/SpryMenuBarHorizontal.css and SpryAssets/SpryMenuBar.js but my basic style.css and jquery.js is being removed from the page.

This behavior is spoiling the style of my webpage and some scripts based on jquery is not working.

But on my home page i want both the CSS and javacript to be present.

Thank you for your replies in advance.

Amit Goda
Ranch Hand

Joined: Jan 21, 2012
Posts: 37

Hello again,

There's no reply on this thread, but after two day of googling and trying to solve the above error i finally found the cause.

My struts 2 implementation was using Tiles 2.0.6, and inheritance was not taking place.

Than i found this link which stated that inheritance is taking place but all the files are repeated with each level of inheritance.

Thus the Tiles version below 2.1.3 had bugs related to Tiles put-list-attribute inheritance and it was resolved in version 2.1.3.

Tiles bug 2.1.3 can be seen here

So i changed the Tiles version to 2.2.2.

And hurray my put-list-inheritance worked with the very first try.

I agree. Here's the link:
subject: Tiles put-list-attribute inheritance
It's not a secret anymore!