Now that the code is legible we find this suspicious spot:
Inside ther loop you always set the same attribute which is however derived from the ResultSet.
Not unconceivable, but still suspicious.
We do not know what Result is and what ResultSupport.toResult does.
Just for the moment we'll ignore the fact that all your database access and data manipulation should be in a DAO and not in the servlet. But the immediate problem here is trying to pass the result set to the jsp page. The result set needs to be processed into a collection of some sort and that collection will be set as a request attribute. The jsp doesn't know what to do with a ResultSet object.
He's not passing the resultset to the JSP, he's processing it using a JSTL package class (used to support the SQL JSTL tags) to create a Result, which I presume is JSTL-compatible.
Bear Bibeault wrote:He's not passing the resultset to the JSP, he's processing it using a JSTL package class (used to support the SQL JSTL tags) to create a Result, which I presume is JSTL-compatible.
Ah, well that something different. I saw "request.setAttribute("result", result);" and made a bad assumption. I see Ivan picked up on the ResultSupport.toResult() thing. Now I'm curious to see what that is actually doing.
The ResultSupport and Result classes are defined by the JSTL to support the sql tags. I'd never use the sql tags in a page, and I've also never used the Result classes.
I either do all my jDBC deep in the model, or let an ORM package do it for me, so a resultset never gets this close to the UI.
To the OP: what have you done to debug this issue?
Post by:autobot
He baked a muffin that stole my car! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards