Okay, Andy -- JSTL operates on scoped variables not scripting variables. You are trying to access scripting variables. I found this good primer on JSTL that explains this at http://www-106.ibm.com/developerworks/java/library/j-jstl0211.html

andy wix wrote:
Hi,

In trying to resolve another (more Struts related!) problem someone suggested using a <c:forEach tag, but I can't get it to output anything to the screen. I have omitted the html for clarity but have created a simple class called test that has 1 instance variable called name and a getter and setter.

<%@ taglib uri="jstl/c" prefix="c" %>

<%
 Test con1 = new Test();
 Test con2 = new Test();
 con1.setName("Fred");
 con2.setName("Dog");

 ArrayList xxx = new ArrayList();
 xxx.add(con1);
 xxx.add(con2);
%>

<c:forEach items="${xxx}" var="temp">
  Name: <c:out value="${temp.name}" />
</c:forEach>

Should this ouput the 2 names to the page?
I can do a <c:out successfully on its own so I suspect the taglib is seen correctly.


Thanks,
Andy

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to