I create ResultSet object in servlet and save it in requests scope: PreparedStatement pstmt; ... ResultSet searchResults = pstmt.executeQuery(); request.setAttribute("searchResults", searchResults); Then in jsp: <sql:resultSet id="rs1" name="searchResults" scope="request"> <sql:getColumn colName="name"/><br> </sql:resultSet> It works fine, if searchResults has any records. If searchResults is empty, then once again will be output the result from the previous call to <sql:resultSet>. I have already made changes in my local copy of ResultSetTag.java to fix this problem and it works. If you interested, I can mail you my changes. Good luck.
Hmm, that looks like a container caching problem, similar to bug belo (on <c:out>): http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26320
Yes, this is the bug I've reported long ago: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16830. I've even created a fix, but noone seems to care.
Ok, I did a fix similar to that one mentioned on bug 26320: I'm calling super.bodyContent = null at doStartTag(). Is that the fix you have in mind?
Created attachment 10555 [details] JSP page that reproduces the error (must have hsqldb.jar on WEB-INF/lib)
Created attachment 10556 [details] Output of the test case with dbtags-b1.jar
Created attachment 10557 [details] Output of the test case after the patch
Committed change on CVS (will appear on next nightly build)
*** Bug 21647 has been marked as a duplicate of this bug. ***
*** Bug 18767 has been marked as a duplicate of this bug. ***
*** Bug 22927 has been marked as a duplicate of this bug. ***
*** Bug 4877 has been marked as a duplicate of this bug. ***