struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andriy Kharchuk" <andriy.kharc...@gmail.com>
Subject Struts 2: Can not set Action's property which is an array of Strings
Date Mon, 28 Jan 2008 21:14:47 GMT
Hi guys,

My Action has property which is an array of Strings. I'm rendering html
table using this property. What is correct way to update this property from
jsp?

I tried the following but it doesn't work:

1. JSP
<s:iterator value="entityList" status="rowstatus">
    <s:textfield name="selectedItems[%{#rowstatus.index}]"/>

2. Action
    private String[] selectedItems;

    public String[] getSelectedItems(){
        return selectedItems;
    }

    public void setSelectedItems(String[] selectedItems){
        this.selectedItems = selectedItems;
    }

Exception is
[ERROR] 23:11:16,750 InstantiatingNullHandler | Could not create and/or set
value back on to object |
com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue(
InstantiatingNullHandler.java:110)| nullPropertyValue
java.lang.InstantiationException: [Ljava.lang.String;
    at java.lang.Class.newInstance0(Unknown Source)

I will appreciate any help.

Thanks,
Andriy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message