David
      If you destroy the bean before you use the ResultSet that has been
returned, this will close your ResultSet.  If you are going to use a
ResultSet, you must make sure that the object that created the ResultSet
still exists.  I would not return a ResultSet from the bean, but I would
probably make the bean fill some sort of list object which can be
disconnected from the database (Vector, Hashtable, etc...) and then return
that to your jsp.  By filling a list object, you can pass that back to the
jsp and you do not have to worry about database connections in your jsp

Bill Manuel
The Kroger Company
Manufacturing Systems
[EMAIL PROTECTED]



|---------+----------------------------------->
|         |           "David Chu"             |
|         |           <[EMAIL PROTECTED]>      |
|         |           Sent by:                |
|         |           mvc-programmers-admin@ba|
|         |           sebeans.com             |
|         |                                   |
|         |                                   |
|         |           06/21/2002 09:23 AM     |
|         |           Please respond to       |
|         |           mvc-programmers         |
|         |                                   |
|---------+----------------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       [EMAIL PROTECTED]                                      
                                          |
  |       cc:                                                                          
                                          |
  |       Subject:  [MVC-Programmers] Newbie: pass ResultSet to JSP?                   
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




I am trying to get my head around this struts framework for the first time.
I am confused about the best/standard way to access data from a JSP.

- Let's say I want a page list_items.jsp.
- I have access to a bean that has a method that returns the results of a
database query as a ResultSet object.
- How should I iterate through the rows of the bean?
- Complication: my jsp complains that the ResultSet object has been closed
(because I closed the query)

Is this the prefered encapsulator of data that I should be accessing
through
my JSP?  Hopefully I can use the <struts-logic:iterate> tag.

Thanks for helping out a new struts developer!

-david

------------------------------
David C. Chu
America Online
Network Tools Intern
------------------------------


_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.basebeans.com:8081/mailman/listinfo/mvc-programmers




_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.basebeans.com:8081/mailman/listinfo/mvc-programmers

Reply via email to