0

I'm using Datastax Java Driver and JSP.

In java, I can use this code. Both ResultSet and Row are from Datastax java driver.

ResultSet results = a.selectAccumulationByDate();
for (Row row : results) {
    System.out.println(row.getString("event"));
}

When I use JSP with this code

<c:forEach var="apps" items="${list}">

I get this error

javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items"

So far the solution is sending them as a list. But it will take two times reading the whole list. Is there anyway I can send this ResultSet and process it in JSP?

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Andrei Dharma
  • 47
  • 2
  • 9
  • 1
    Send resultset to jsp is a bad idea first build objects – Koitoer Feb 18 '14 at 04:14
  • Yes create bean class and send list of that to your jsp and that can be easily iterated – Dhruv Pal Feb 18 '14 at 05:55
  • `list` was a ResultSet. Thank you, I will try to process it in my server side. But, if I have a lot of rows, I have to iterate once in to translate it into list, and once more in the jsp for viewing purposes. Is there any better way for this? Or, is this the best that I can do? – Andrei Dharma Feb 18 '14 at 07:46
  • What about this ? http://stackoverflow.com/a/6416800/977087 – Crowie Mar 03 '14 at 22:20

0 Answers0