You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/09/01 11:38:45 UTC
RE: Identifying the 'clicked' line when iterating over collection
Hi,
I am trying to follow the advice given yesterday but am now baffled by the
basic jstl stuff.
I have cut it down to basics and still get no output actually written to the
page. I've tried all variations on the theme (have the arraylist in the
session, use c:outs in the "<TD>" tags etc).
The code is (I have omitted the html stuff):
<%
Contact con1 = new Contact("name1");
Contact con2 = new Contact("name2");
ArrayList contacts = new ArrayList();
contacts.add(con1);
contacts.add(con2);
%>
<TABLE border="1">
<c:forEach var="contact" items="${contacts}" varStatus="status">
<TR>
<TD width="5">${status.index}</TD>
<TD width="150">${contact.name}</TD>
</TR>
</c:forEach>
</TABLE>
<c:out value="Testing"/>
The c:out tag at the end is the only bit that works (writes to the page) so
I assume the taglib declaration at the top of the file is OK.
Cheers,
Andy
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org