aspose file tools*
The moose likes Servlets and the fly likes servlet-jsp communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet-jsp communication" Watch "servlet-jsp communication" New topic
Author

servlet-jsp communication

Sagar Jagtap
Greenhorn

Joined: Jul 09, 2001
Posts: 1
I want to pass ResultSet object from servlet to JSP.
Is it possible,if yes how?
Plz suggest me possible solns. ASAP.
sagar
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
If you are forwarding to a JSP, any object you want can be attached to the request with setAttribute. However, you better be very sure that the ResultSet gets closed properly, no matter what happens.
Bill
Ashutosh Uprety
Ranch Hand

Joined: Nov 30, 2000
Posts: 39
you can do that using setAttribute() method which will put values in the session.
But as a practice it is advisable not to do that. You can always get other ways to achieve the functionality u want.
Jayson Falkner
Author
Ranch Hand

Joined: May 07, 2001
Posts: 57
Instead of setting objects in the session scope, use request scope. Placing objects in session scope is mainly unfavored because the object will stick around until the session times out. With request scope this is not the case.
Here is a FAQ that covers this question and provides a code example.
http://www.jspinsider.com/faq/12.view
Jayson Falkner
jayson@jspinsider.com


Jayson Falkner<br />jayson@jspinsider.com<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet-jsp communication