You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Fredrik Östling <fr...@yahoo.com> on 2002/01/18 09:09:10 UTC
Indexed properties and BeanUtils.populate exception.
I have multiple select tag in my JSP as follows:
<html:select multiple="true" size="5"
property="testStrings">
<html:options collection="appellationTypes"
property="name" labelProperty="name"/>
</html:select>
In my form bean I have these getters and setters:
public void setTestStrings( String[] in )
{
System.out.println("setTestStrings( String[] in )");
testStrings = in;
}
public void setTestStrings( int index, String in )
{
System.out.println("setTestStrings( int index,
String in )");
testStrings[index] = in;
}
public String[] getTestStrings()
{
System.out.println("getTestStrings()");
return testStrings;
}
public String getTestStrings( int index )
{
System.out.println("getTestStrings( int index )");
return testStrings[index];
}
The problem is that if I select one or more fields in
the multiple select box and post it I get this
annoying Exception:
javax.servlet.ServletException: BeanUtils.populate
Struts should handle indexed properties, shouldnt it?
What am I doing wrong?
I dont know how to debug this either.
/ Fredrik
_____________________________________________________
Hitta snörapporter...
från 500 olika skidorter i Europa
på http://se.snow.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Indexed properties and BeanUtils.populate exception.
Posted by Arron Bates <ar...@keyboardmonkey.com>.
Rest assured that the BeanUtils package does handle indexed properties.
The user-mailing list has handled this issue recently. Take a walk
through the user-list history or ask the user-list.
Arron.
Fredrik Östling wrote:
>I have multiple select tag in my JSP as follows:
><html:select multiple="true" size="5"
>property="testStrings">
> <html:options collection="appellationTypes"
>property="name" labelProperty="name"/>
></html:select>
>
>In my form bean I have these getters and setters:
> public void setTestStrings( String[] in )
> {
> System.out.println("setTestStrings( String[] in )");
> testStrings = in;
> }
>
> public void setTestStrings( int index, String in )
> {
> System.out.println("setTestStrings( int index,
>String in )");
> testStrings[index] = in;
> }
>
> public String[] getTestStrings()
> {
> System.out.println("getTestStrings()");
> return testStrings;
> }
>
> public String getTestStrings( int index )
> {
> System.out.println("getTestStrings( int index )");
> return testStrings[index];
> }
>
>The problem is that if I select one or more fields in
>the multiple select box and post it I get this
>annoying Exception:
>javax.servlet.ServletException: BeanUtils.populate
>
>Struts should handle indexed properties, shouldnt it?
>What am I doing wrong?
>
>I dont know how to debug this either.
>
>/ Fredrik
>
>
>
>
>_____________________________________________________
>Hitta snörapporter...
>från 500 olika skidorter i Europa
>på http://se.snow.yahoo.com
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>