title: How do I make a Java ResultSet available in my jsp?
body: <p>I'd like to swap out an sql:query for some Java code that builds a complex query with several parameters.  The current sql is a simple select.</p>
  
  <pre>
  &lt;sql:query
     var="result"
     dataSource="${dSource}"
     sql="select * from TABLE ">
  &lt;/sql:query>
  </pre>
  
  <p>How do I take my Java ResultSet (ie. rs = stmt.executeQuery(sql);) and make the results available in my JSP so I can do this textbook JSP?</p>
  
  <p>To be more clear, I want to remove the above query and replace it with Java.</p>
  
  <pre>
  &lt;%
    ResultSet rs = stmt.executeQuery(sql); // Messy code will be in some Controller
  %>
  </pre>
  
  <pre>
  &lt;c:forEach var="row" items="${result.rows}">
    &lt;c:out value="${row.name}"/>
  &lt;/c:forEach>
  </pre>
  
  <p>Do I set the session/page variable in the Java section or is there some EL trick that I can use to access the variable?</p>