On Mon, Aug 29, 2011 at 5:02 AM, Antonio Petrelli < [email protected]> wrote:
> 2011/8/28 Rick R <[email protected]> > > > Here's how I thought I'd set it up: > > http://pastie.org/2441904 (not showing menu.jsp) > > > > You are trying to put an attribute that belongs to an included page > (plainBody.jsp) in a definition that includes it. > Either you define a new definition that uses plainBody.jsp (ideally, any > JSP > page that has a tiles:insertAttribute should be used as a template of a > definitio), or use: > cascade="true" > in <put-attribute> > > Beware, cascade is powerful, but it is dangerous if there are places that > require the same attribute names. > > Thanks for replying Antonio. Grasping this is slow going :) Using cascade="true' definitely helped. I cleaned things up a little bit and below is the new tiles definition page, which is actually working! Here is my new relevant info (you'll see cascade = true on the content put attribute calls): http://pastie.org/2449471 What is driving me crazy though is "How would you accomplish this "without" using cascade='true' ?" (In fact I think the application I'll eventually have to integrate with is using a very old version of Tiles (1?) that doesn't have cascade? ) You mentioned above "Either you define a new definition that uses plainBody.jsp... ," which I 'think' I did in the above pastie with "plain.body" and 'standard.body' definitions, but if I give it an attribute of content which I expected to be overridden, it's not overridden. As an example in the below I'll end up with "foo bar 2" as the content instead of the 'signup' definition put-attribute content (if I remove cascade = true on the signup put-attribute .) <definition name="plain.body" templateExpression="/WEB-INF/layouts/plainBody.jsp"> <put-attribute name="content" value="foo bar 2"/> <!-- never really overridden ??? --> </definition> Thanks again for all your help. I'd think my situation is a common one. In fact here is an example of a common situation https://img.skitch.com/20110829-q8iby8jayc76qif2drcdrrwhpk.jpg There should be an easy way to not have to redefine the <html><head>.. //common stuff</head> ... <div id="footer">..</div></body></html> section for all three layouts. The body content obviously varies. I have things working with cascade="true" so I'm content there - but I'm still curious how it would be done without it?
