With Tiles, you can do something like :

<template:insert template='/chapterTemplate.jsp'>
  <template:putList name='listName >
    <template:add content='name_1'/>
    <template:add content='name_2'/>
  <template:putList />
</template:insert>

 and in the template itself :

<template:importAttribute name="listName" />
  <!-- this import tiles attribute in the jsp page context -->

<logic:iterate id="x" name="listName">
  <bean:write name="x"/>
</logic:iterate>


Also, template description can be defined in a separate file, and you
can use role with <add  content="" role="" /> (for now in jsp page, will
be soon available in definition file).

[EMAIL PROTECTED] wrote:

> > You mean something like this?
> >
> > <logic:iterate id="x" >
> >     <template:get name="<%= x %>" />
> > </logic:iterate>
> >
> > I am not sure, whether this is possible in the
> > soon-to-be-deprecated template
> > tags or in the tiles tags, but the idea is good.
>
> No, I mean a caller like:
>
> <template:insert template='/chapterTemplate.jsp'>
>   <template:put name='name[0]' content='name_0'/>
>   <template:put name='name[1]' content='name_1'/>
>   <template:put name='name[2]' content='name_2'/>
> </template:insert>
>
> Then in the template itself:
>
> <logic:iterate id="x" name="name">
>   <bean:write name="x"/>
> </logic:iterate>
>
> So the <template:put> would recognize that name needs
> to be a list and create the bean accordingly.
>
> Devon

Reply via email to