You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leon Rosenberg <st...@anotheria.net> on 2005/07/11 11:37:44 UTC
Re: Tiles
<logic:iterate name="listQuestions" id="question" toScope="page"
type="java.lang.String">
<tiles:insert name="<%=question%>" flush="true" />
</logic:iterate>
Unfortunately you can't get rid of the <%=question%>, but it would be the
only java code in the page.
Regards
leon
> -----Ursprüngliche Nachricht-----
> Von: Dewitte Rémi [mailto:remi@gide.net]
> Gesendet: Montag, 11. Juli 2005 13:33
> An: Struts Users Mailing List
> Betreff: Re: Tiles
>
> I answer myself. I achieved doing this :
> <tiles:useAttribute id="listQuestions" name="listQuestions"
> classname="java.util.List" />
> <%
> java.util.Iterator i=listQuestions.iterator(); while( i.hasNext() )
> {
> String question= (String)i.next();
> %>
> <tiles:insert name="<%=question%>" flush="true" />
> <br>
> <%
> }
> %>
>
> Is there any way to do this with tags ? I would like my
> presentation pages don't have java code like this.
>
> Rémi
>
> Le Lundi 11 Juillet 2005 13:20, Dewitte Rémi a écrit :
> > Hi !
> > I make a definition in which i put a list of tiles to include but I
> > can't achieve to do this eg :
> > in my tiles-defs.xml :
> > <definition name="page1-def" extends="baseDef">
> > <put name="page" value="1"/>
> > <putList name="listQuestions">
> > <add value="/Q/firstName.jsp"/>
> > <add value="/Q/lastName.jsp"/>
> > </putList>
> > </definition>
> >
> > And in my template, i don't know how to iterate in listQuestions in
> > order to include /Q/firstName.jsp and /Q/lastName.jsp.
> > A start :
> > <tiles:importAttribute/>
> > <c:out value="${listQuestions}"/>
> > <c:forEach items="${listQuestions}" var="question">
> > What to do to include question !
> > </c:forEach>
> >
> > Maybe it's not possible...
> > Thanks.
> > Rémi
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org