Hi

I am developing a site using JSP and Servlets using the Model View
Controller design pattern. At the moment, any information that is to be
displayed in the page is retrieved from the database in the Servlet, placed
into some sort of Object which is then placed in a Vector. This Vector is
then added to the session and retrieved by the JSP using something like:

<%
 // Get the Vector (containg the user object) from the session
 Vector userDetails = (Vector) session.getValue("user.theuser");

 // Get the user object from the Vector
 User theUser = (User) userDetails.elementAt(0);
 %>

 <!-- Now display the info in the object -->
 <b>User Name:</b> <%= theUser.getName() %><br>
 <b>Password:</b> <%= theUser.getPassword() %><br>
 <b>Telephone:</b> <%= theUser.getTel() %><br>
 etc. etc.

I was wondering what would be the best way, using similar techniques, to
retrieve a lot of of information from the database (say product and price
information. There could be anywhere from 0 to numerous rows returned which
would all be displayed one under the other on the page) and send this to the
JSP to be displayed. Could I send the whole ResultSet to the page and then
retrieve the info from it there? or is there a better way of doing this? Any
ideas would be a great help.

Thanks

Pete

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to