commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Scott <>
Subject StringArray
Date Wed, 26 Nov 2003 19:41:15 GMT
I have an array of strings that I would like to copy over to a bean that 
uses a map using BeanUtils.setProperty;
When I do this, the first element of the array is converted to a String 
and this is the value for my key.  How do I go about getting the
whole array assigned to the key instead of the first element?


***My bean***
public class Foo {

    private HashMap values = null;
    public Foo(){
        values = new HashMap();
    public void setValue(String key, Object value){
           values.put(key, value);
       public Object getValue(String key){
           return values.get(key);

*** My test ****

public class TestBeanUtils {

    public static void main(String[] args) throws Exception {
        Object value = null;
        Foo foo = new Foo();
        String[] test = {"1","2","3"};
        BeanUtils.setProperty(fooForm, "value(ryan)", test);

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message