Hi,
I am planning to use a Map-Backed Action Form as my default DTO. But I am running into problems when I use indexed properties within the map.
For e.g. I have a form with 10 checkboxes and two text fields. So in my map (in the action form) , I set two strings and one array of size 10.This array just contains strings.
So I have just done
I have written the jsp as
Now when I reference this from the JSP, I am able to load the page. But when I submit it, I get an error saying that there is no getter value defined for selectedOption
Does Struts support an indexed property within a mapped property?
I am planning to use a Map-Backed Action Form as my default DTO. But I am running into problems when I use indexed properties within the map.
For e.g. I have a form with 10 checkboxes and two text fields. So in my map (in the action form) , I set two strings and one array of size 10.This array just contains strings.
So I have just done
Code:
//
String[] stringArray = {.......};
ActionForm.setValue ( "selectedOption" , stringArray );
//
I have written the jsp as
Code:
<%
for ( int i = 0; i < 10 ; i++ )
{
String temp = "value(selectedOption[" + i + "])";
%>
<html:multibox property="<%=temp%>" name="<%=temp%>"/>
<%
}
%>
Now when I reference this from the JSP, I am able to load the page. But when I submit it, I get an error saying that there is no getter value defined for selectedOption
Does Struts support an indexed property within a mapped property?