Bug 26863 - error in ResultSetTag if ResultSet is empty
Summary: error in ResultSetTag if ResultSet is empty
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: DBTags Taglib (show other bugs)
Version: 1.0B1
Hardware: PC other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 4877 18767 21647 22927 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-11 16:41 UTC by ttor
Modified: 2004-11-16 19:05 UTC (History)
5 users (show)



Attachments
JSP page that reproduces the error (must have hsqldb.jar on WEB-INF/lib) (1.83 KB, text/plain)
2004-02-25 22:37 UTC, Felipe Leme
Details
Output of the test case with dbtags-b1.jar (392 bytes, text/plain)
2004-02-25 22:41 UTC, Felipe Leme
Details
Output of the test case after the patch (371 bytes, text/plain)
2004-02-25 22:42 UTC, Felipe Leme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ttor 2004-02-11 16:41:26 UTC
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.
Comment 1 Felipe Leme 2004-02-11 18:40:15 UTC
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
Comment 2 Vit Timchishin 2004-02-12 15:11:13 UTC
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.
Comment 3 Felipe Leme 2004-02-25 22:36:15 UTC
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?


Comment 4 Felipe Leme 2004-02-25 22:37:06 UTC
Created attachment 10555 [details]
JSP page that reproduces the error (must have hsqldb.jar on WEB-INF/lib)
Comment 5 Felipe Leme 2004-02-25 22:41:02 UTC
Created attachment 10556 [details]
Output of the test case with dbtags-b1.jar
Comment 6 Felipe Leme 2004-02-25 22:42:09 UTC
Created attachment 10557 [details]
Output of the test case after the patch
Comment 7 Felipe Leme 2004-02-26 12:48:09 UTC
Committed change on CVS (will appear on next nightly build)
Comment 8 Felipe Leme 2004-02-26 19:42:01 UTC
*** Bug 21647 has been marked as a duplicate of this bug. ***
Comment 9 Felipe Leme 2004-02-27 03:13:38 UTC
*** Bug 18767 has been marked as a duplicate of this bug. ***
Comment 10 Felipe Leme 2004-02-27 06:05:40 UTC
*** Bug 22927 has been marked as a duplicate of this bug. ***
Comment 11 Felipe Leme 2004-02-27 13:47:08 UTC
*** Bug 4877 has been marked as a duplicate of this bug. ***