You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gu...@ribera.tel.uva.es on 2003/01/16 23:59:05 UTC

FormBean array properties

Hi

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?

Thanks a lot,
Guido GarcĂ­a.

------------------------------------------------------------------------
Soy cliente de Retecal y me siento estafado, no se lo recomiendo a nadie


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>