tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Re: Help on Tiles
Date Mon, 31 Mar 2008 05:12:01 GMT
If you're talking about iterating a list attribute like:

    <put-list-attribute name="scripts">
      <add-attribute value="script/cookies.js" type="string"/>
      <add-attribute value="script/duallist.js" type="string"/>
      <add-attribute value="script/tab.js" type="string"/>
      <add-attribute value="script/list.js" type="string"/>
    </put-list-attribute>

Then you can use something like:

    <tiles:importAttribute scope="request"/>

    <c:forEach items="${scripts}" var="s">
      <script language="JavaScript" type="text/javascript"
src="${pageContext.request.contextPath}/${s}"></script>
    </c:forEach>

(*Chris*)
On Sun, Mar 30, 2008 at 10:06 PM, sandyvj83 <sandeepvj83@gmail.com> wrote:
>
>  Hi All,
>
>  We have a requirement that we need to iterate the attributes given in
>  definition of the tiles.xml and then  display them. Can anyone tell me how
>  to access the attributes given in the tiles.xml in a jsp, so that i can
>  iterate through it. We are using tiles-2 . In tiles-1 the following code was
>  used:
>
>
>  <tiles:useAttribute id="list" name="list" classname="java.util.List" />
>  <logic:iterate id="name" name="list" type="java.lang.String">
>  <tr>
>     <td>
>     <tiles:insert beanName="name" flush="false" />
>     </td>
>  </tr>
>  <tr>
>
>
> </tr>
>  </logic:iterate>
>
>
>
>  Thanks,
>  Sandeep
>
>
>  --
>  View this message in context: http://www.nabble.com/Help-on-Tiles-tp16391999p16391999.html
>
>
> Sent from the tiles users mailing list archive at Nabble.com.
>
>

Mime
View raw message