• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dispatching ResultSet object from Servlet to JSP

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Thanks.




I'm using RequestDispatcher object to
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic