This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles put-list-attribute inheritance" Watch "Tiles put-list-attribute inheritance" New topic
Author

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
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.

Cheers!!!
 
 
subject: Tiles put-list-attribute inheritance
 
Similar Threads
using css file in jsp along with tiles
Tiles 2.1 integration with Spring 3.0
spring 3 and tiles 2.1.4 - basic problem
How do i change only body page in tiles.xml file in struts2
calling new jsp from tiles:insert attribute