wood burning stoves 2.0*
The moose likes Servlets and the fly likes Dispatching ResultSet object from Servlet to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dispatching ResultSet object from Servlet to JSP" Watch "Dispatching ResultSet object from Servlet to JSP" New topic

Dispatching ResultSet object from Servlet to JSP

Yogender Butola

Joined: Jul 19, 2004
Posts: 12
I'm creating a database connection in a servlet. In the same servlet I'm retrieving the data from the data base into a ResultSet object say 'rs'. Now, when I try to put this object in he Request object [request.setAttribute("result",rs)] an exception is thrown that is "Attribute has no value". I've successfully used this technique for forwarding the Exception object to the error page in the catch block of the same servlet. I don't why it's giving the error. When I try to display the values of the ResultSet object "rs" it displays all the values, which indicates that the resultset is not empty. pls ans asap.

I'm using RequestDispatcher object to
unni krishna
Ranch Hand

Joined: Jul 14, 2004
Posts: 39
Don't put rs into request, use a value object instead. This is a general advice, not related to the error that you are getting.

Software Engineer (SCJP)<br />USTechnology, CA
Don't get me started about those stupid light bulbs.
subject: Dispatching ResultSet object from Servlet to JSP
Similar Threads
a weird thing, please help.
show database on applet
Problem retrieving BLOB through resultset
Reflection problem: object is not an instance of declaring class