struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvanma...@comcast.net (Gary VanMatre)
Subject Re: [Tiles] Inline definitions (WAS: [Tiles] Embedding tiles inside of tiles)
Date Thu, 08 Jun 2006 16:53:28 GMT
>From: Greg Reddin <greddin@apache.org> 
>
> Yep, that's come up before. Personally, I don't like the idea. 
> Think about how complicated that could become with nested, nested 
> defs. I'd prefer better support for including other definitions as a 
> tile attribute. Maybe that support is there already and i just 
> haven't tried it. 
>

In concept, this is what Clay allows you to do.  The "component" is the outer most 
definition.  Under that you can create composition using the "element" which has to reference
a top-level definition.  So, in Antonio's example, the nested tile definition (path="/header2.jsp")
would need to reference a top level definition and in doing so would extend it like a java
anonymous class. 

Clay symbols are similar to the "put"s.  The difference is that they are pushed to all nested
definitions and not just a single level.  They are scoped from the outer to the inner.  They
can be overridden at any level.  This functions pretty much like Antonio describes below.
  


Gary

> Greg 
> 
> 
> On Jun 8, 2006, at 11:06 AM, Antonio Petrelli wrote: 
> 
> > Greg Reddin ha scritto: 
> >> As long as your layout is completely defined in one JSP page this 
> >> will all work. It breaks down if your layout has separate pages 
> >> for header, footer, etc. See below: 
> >> 
>>> <definition name="tileA" path="/layout.jsp">
>>>   <put name="header" value="/header1.jsp"/>
>>>   <put name="headerGraphic" value="image1.gif"/>
>>>   <put name="someOtherThing" value="..."/>
>>> </definitioin>
>>>
>>> <definition name="tileB" extends="tileA">
>>>   <put name="header" value="header2.jsp"/>
>>>   <put name="headerGraphic" value="image2.gif"/>
>>> </definition>
>>>
> >> 
> >> Above you want to define your header differently for two layouts 
> >> and you want to pass different images in. This won't work because 
> >> the headerGraphic attribute will not be passed along to the header 
> >> page unless you do it manually from the page where it is inserted. 
> > 
> > Uh, this makes me think about a possibility to support something 
> > like "inline definitions" such as: 
> > 
>> <definition name="tileB" extends="tileA">
>>  <put name="header">
>>    <definition path="/header2.jsp">
>>       <put name="headerGraphic" value="image2.gif" />
>>    </definition>
>>  </put>
>>  <put name="headerGraphic" value="image2.gif"/>
>> </definition>
>>
> > 
> > Do you think it could be a good solution? 
> > Ciao 
> > Antonio 
> > 
> > --------------------------------------------------------------------- 
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org 
> > For additional commands, e-mail: dev-help@struts.apache.org 
> > 
> > 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org 
> For additional commands, e-mail: dev-help@struts.apache.org 
> 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message