> On my page I want 5 listboxes containing thesame result
> from a DB.
> The resultset is retrieven when calling a bean(getTheRS)
> Which way is the fastest?

Containing the same results? Do u mean u've to print, in the same page, 5
times the same listbox?

I did an Utility class containing a method like:

public static String getDBCombo(String sql, String comboName [, String
defalutValue]);

The sql has 2 select fields: the first one will be the id of the <option>
tag, the second one will be the value.
It queries the db and builds a string containing the html codes to show the
listbox.
Something like
<select name=comboName>
  <option value=id1>Name1
  <option value=id2>Name2
   ...
</select>

Then in the jsp page:
....
<% String listBox= Utility.getDBCombo("select id, name from dealers",
names);
%>
<!-- prints out 5 times the same listbox -->
<%= listBox %>
<%= listBox %>
<%= listBox %>
<%= listBox %>
<%= listBox %>

Is this what u were searching for?

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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