Does anyone know how to use indexed properties?

I want the elements of my HTML form to be able to set properties in a bean
without having to specify the exact name of the property.

For example :

   Instead of...
       Form element foo -> Bean getFoo and setFoo
       Form element bar -> Bean getBar and setBar

   I want...
      Form element foo -> Bean getBat(1) and setBat(1)
      Form element bar -> Bean getBat(2) and setBat(2)

Is this possible?

Here is an example of why I want it.  Say there is a contact list in a
database.  Each contact in the database has address, phone, name fields.  I
could hardcode the form and the bean to these field names, but that's not a
good solution because it takes a fair amount of work to suddenly add a cell
phone field (add it to the DB, add it to the form, add it to the bean, add
it to the data access object to put it in the DB, etc.).  I'd like the form
and the bean to be automatically flexible to handle the structure found in
the database on the fly (add it to the DB only, the rest is automatically
taken care of).

Thanks,

Casey

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

Reply via email to