> I have a multiple select html element named "countries" in a form.
> How should my FormBean getters and setters be?
> public String[] getCountries()
> { return this.countries; }
> public String getCountries(int index)
> { return this.countries[index]; }
> public void setCountries(String[] countries)
> { this.countries = countries ; }
> public void setCountries(int index, String countries)
> { this.countries[index] = countries }
> or should I use an ArrayList or something like that instead of the
String[] array?
> Are both them allowed? Should I use only String and boolean properties?
> Are the indexed accesors useful?
I have seen problems with beans like this-- overloaded getters and setters
really confuse the mechanism that copies properties around. I don't think
this conforms to the JavaBeans spec, either.
How about getCountryByIndex and setCountryByIndex instead?
Then again, I have not used indexed properties in an ActionForm, so I may be
completely off base here.
--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management