Actually, this seems to me to be the perfect opportunity to create a custom
tag. So far, I have only created tags to conditionalize our online help, but I
know that you can create tags for iteration. You could put in something like
this:

  <mylib:List type="pull-down" source="USStates" />

and then code the corresponding Java class to blow this out into a full HTML
pull-down list box. Sure is a lot cleaner than putting in a bunch of <% %>
code. And a lot easier to maintain, too.

-David Castro
 [EMAIL PROTECTED]

--- Jim Preston <[EMAIL PROTECTED]> wrote:
> A question for experienced JSP/bean developers:
>
> It seems to me that a common task in a JSP is to output a list of some sort
> where the contents and length of the list are variable and obtained from a
> bean (for example, when creating a pull-down menu of dynamic options). And
> from what I've read, there's no automatic way to do that (by automatic
> I mean something akin to "jsp:getProperty"). So it has to be programmed,
> having the bean return an array or an Enumeration (etc.), and then using
> a scriplet to loop through the elements.
>
> But for the same reasons that "jsp:getProperty" is preferred over using
> an expression tag to access the bean's "get" method directly, I would
> think that there'd be something similar for looping through dynamic lists.

__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

===========================================================================
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