<c:set var="linkListKey"><%=Constants4Lists.LINK_LIST %></c:set> <c:forEach var="idata" items="${requestScope[linkListKey]}"> <blacksail:row oddStyleClass="odd" evenStyleClass="even"> <td class="listTitle"> <html-el:link href="${idata.url}" target="_blank"> <c:out value="${idata.title}" default="error"/> </html-el:link> </td> </blacksail:row> </c:forEach>
Constants4Lists is a class which has string constants to use for putting objects into request or session. <c:set> puts the string from its body into the var linkListKey. The EL in the <c:forEach> items attribute uses this to locate the list. Hey presto, you're done!
Adam
On 09/04/2003 04:51 PM Andy Richards wrote:
hi
I use RowSetDynaClass to get my results from a db then i add these rows to a List via getRows(). The list is then returned to my jsp page which is using jstl and struts-el. I would like to use c:forEach to iterate over the list and print out the variables. Within the loop i would like to use struts-el html:link as follows...
<html:link page="$my_var"><c.out value="${my_var}" /></html:link>
Does anyone know if what i am trying to do is possible as i keep getting errors??
I not sure how to correctly pass my list to c:forEach..... any ideas
Thanks
Andy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]