You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Gross <ax...@iaeste.at> on 2004/03/01 14:37:23 UTC

tiles - smth like addToList?

Hi people!

Concerning tiles definition and extension of those.
First part-o-mail: concrete problem
Second part-o-mail: a more general approach (beginning of it ;)

  First part:
I see the need for extending the entries of a putList without overriding the
entries in the super definition.
Example:
 <definition name=".head.common" path="htmlHead.jsp">
	<putList name="httpEquiv">
		<item value="pragma" link="no-cache" />
		<item value="cache-control" link="no-cache" />
		<item value="expires" link="0" />
	</putList>
 </definition>

 <definition name=".head.project" extends=".head.common">
	<putList name="httpEquiv">
		<item value="expires" link="1" />
		<item value="description" link="tiles definition extension example" />
	</putList>
 </definition>
so usually this would replace the list in .head.common with the one in
.head.project
desired behaviour would be to just add the new entries ("description") and overwrite those
which are already present ("expires").
Even without the feature to overwrite old values, it would be really nice to have
a tag for that (i.e. <addToList name="httpEquiv">..).
At the moment I use 'specialised' definitions (wrapping those attributes
likely to change in another definition), as I didn't go deep into tiles code until
now. But that just works in some cases.

  Second part:
I think to have this as a general capability would make a lot of sense
(virtually adding+replacing nodes in the definition to those the superdefinition 
at the same place of hierarchy)
Especially if the other config files are going to support extension, too.
So questions arise;
 did anybody do this?
 do others think there's a real need?
 how to judge, which nodes should be overwritten?


thanks for your patience,
Axel

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: tiles - smth like addToList?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 03/01/2004 06:12 PM Axel Groß wrote:
> On 2004-03-01 at 17:53:30 +0100, Adam Hardy wrote:
>>>I see the need for extending the entries of a putList without overriding 
>>>the entries in the super definition.
>>>Example:
>>><definition name=".head.common" path="htmlHead.jsp">
>>>	<putList name="httpEquiv">
>>>		<item value="pragma" link="no-cache" />
>>>		<item value="cache-control" link="no-cache" />
>>>		<item value="expires" link="0" />
>>>	</putList>
>>></definition>
>>>
>>><definition name=".head.project" extends=".head.common">
>>>	<putList name="httpEquiv">
>>>		<item value="expires" link="1" />
>>>		<item value="description" link="tiles definition extension 
>>>		example" />
>>>	</putList>
>>></definition>
>>>so usually this would replace the list in .head.common with the one in
>>>.head.project
>>>desired behaviour would be to just add the new entries ("description") and 
>>>overwrite those which are already present ("expires").
> 
>>this is the behaviour that I use already. I don't know how you manage to 
>> replace the list.
> 
> so you would actually get for .head.project the "pragma" and "cache-control"
> values? I'd be really surprised.. (i don't get them)
> 
> 
>>My definitions inherit the list and its contents. (I 
>>am not sure about replacement).
> 
> mine do too. So for clarification: what happens if you do putList on a name
>  you already did a putList in the superdefinition?

Ah. I spoke too soon. Sorry. I do name the lists seperate names - that's 
why. I name blah1, blah2, blah3. So you're right, it would be good to be 
able to inherit and add to the same name.

Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: tiles - smth like addToList?

Posted by Axel Groß <ka...@iaeste.at>.
On 2004-03-01 at 17:53:30 +0100, Adam Hardy wrote:
> On 03/01/2004 02:37 PM Axel Gross wrote:
> >I see the need for extending the entries of a putList without overriding 
> >the
> >entries in the super definition.
> >Example:
> > <definition name=".head.common" path="htmlHead.jsp">
> >	<putList name="httpEquiv">
> >		<item value="pragma" link="no-cache" />
> >		<item value="cache-control" link="no-cache" />
> >		<item value="expires" link="0" />
> >	</putList>
> > </definition>
> >
> > <definition name=".head.project" extends=".head.common">
> >	<putList name="httpEquiv">
> >		<item value="expires" link="1" />
> >		<item value="description" link="tiles definition extension 
> >		example" />
> >	</putList>
> > </definition>
> >so usually this would replace the list in .head.common with the one in
> >.head.project
> >desired behaviour would be to just add the new entries ("description") and 
> >overwrite those
> >which are already present ("expires").
> 
> Axel,
Hi Adam!

> this is the behaviour that I use already. I don't know how you manage to 
>  replace the list.
??? *puzzled*
so you would actually get for .head.project the "pragma" and "cache-control"
values? I'd be really surprised.. (i don't get them)

> My definitions inherit the list and its contents. (I 
> am not sure about replacement).
mine do too. So for clarification: what happens if you do putList on a name
 you already did a putList in the superdefinition?

> 
> Adam

Axel
> -- 
> struts 1.1 + tomcat 5.0.16 + java 1.4.2
struts 1.1 + tomcat 5.0.19 + java 1.4.2_03
> Linux 2.4.20 Debian
winXP home ed

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: tiles - smth like addToList?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 03/01/2004 02:37 PM Axel Gross wrote:
> I see the need for extending the entries of a putList without overriding the
> entries in the super definition.
> Example:
>  <definition name=".head.common" path="htmlHead.jsp">
> 	<putList name="httpEquiv">
> 		<item value="pragma" link="no-cache" />
> 		<item value="cache-control" link="no-cache" />
> 		<item value="expires" link="0" />
> 	</putList>
>  </definition>
> 
>  <definition name=".head.project" extends=".head.common">
> 	<putList name="httpEquiv">
> 		<item value="expires" link="1" />
> 		<item value="description" link="tiles definition extension example" />
> 	</putList>
>  </definition>
> so usually this would replace the list in .head.common with the one in
> .head.project
> desired behaviour would be to just add the new entries ("description") and overwrite those
> which are already present ("expires").

Axel,
this is the behaviour that I use already. I don't know how you manage to 
  replace the list. My definitions inherit the list and its contents. (I 
am not sure about replacement).

Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org