HI all,
I am trying to figure out how to go from <sql:query var="rs" 
scope="page" dataSource="${conn}"> ... to an ArrayList that I need to 
feed to another taglib.  I've looked through the Hans' JavaServer 
Pages book and found something that looked like it should work:

<% 
  ArrayList testList = new ArrayList();
%>

<c:forEach items="${rs.rows}" var="row" varStatus="status">
  <c:set var="partNum" value="${row.PartNumber}"/>
  <% 
    String partNumber = (String) pageContext.getAttribute("partNum");
    testList.add( partNumber );
  %>
</c:forEach>

<% 
  request.setAttribute( "testList", testList ); 
%>

<display:table name="testList" class="its"/>

However, the page is truncated before it even appears to run this 
code (last line is "<td>00008")?  If I delete the scriptlet in the 
middle of the forEach loop the page displays properly with display 
tag saying that it is empty...  I also tried using:

  <jsp:useBean id="partNum" class="java.lang.String"/>
  <% 
    testList.add( partNum );
  %>

and got the same weird truncation.

I'd appreciate some help on going from the sql tag's row collection 
to an ArrayList.

Thanks,
Eric





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

Reply via email to