Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a list in a map-backed action form

Status
Not open for further replies.

grshekhar

Technical User
Apr 17, 2002
1
US
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

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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top