Hi,
I will tell you how I did it. Since I am stuck with JSP 1.0, I can not use
the taglib stuff yet. So, I decided to use an "html" bean as I call it.
What I do is this:
<select name="some_name"><%= htmlbean.listBox( somebean.getList(),
somebean.getListSelected() ) %></select>
Now, the htmlbean.listBox() does something like:
for( int cntr=0; cntr < inList.size(); cntr++ )
{
Listable item = (Listable) inList.elementAt[cntr];
%>
<option value="<%= item.getId() %>"><%= item.getLabel() %>
<%
}
I realize that using a BEAN to output HTML isnt quite the JSP way of
things..however using it as a TOOLKIT like this I see as ok in my opinion.
You could also put it in JSP .inc files or or .jsp files and just include
them in at the point..but the problem with that is that you cant pass
variables from a bean to it. Instead, you would have to include a
variable.inc file and declare them before use, then SET them.
At any rate..this works well for me. Until I can go to JSP 1.1 and use
Taglibs, I'll do it this way.
Kevin Duffey
Software Engineer
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html