struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject Re: Html tags and "indexed" property - how does it work?
Date Sat, 27 Sep 2003 23:35:28 GMT
Ted Husted wrote:

> This is really a USER list question, but you may be looking for the 
> indexed properties how-to:

I have gone through this howto, but its description of what to do is 
very vague. Here is what I have tried so far:

I have a DynaActionForm with properties defined like so:

         type="java.lang.String[]" />
         type="java.lang.String[]" />

I populate the above inside my action, and display it successfully 
something like so:

<logic:iterate id="policycoverName" indexId="index" name="form" 
   <html:text indexed="true" property="<%=\"policycoverSumInsureds[\" + 
index + \"]\"%>" size="15" />
   <html:submit indexed="true" property="policycoverLess" value="-" />

The above html renders an input text tag, and a submit tag, with correct 
values populated from the DynaActionForm, but incorrect names:


If I submit the form using an external-to-the-above=loop submit button, 
I get no errors, and the DynaActionForm bean is _not_ populated with the 
input text field, which is ignored.

If I attempt to use the "policycoverLess" submit button, struts bombs 
out with the following exception:

	at java.lang.reflect.Array.set(Native Method)
	at org.apache.struts.action.DynaActionForm.set(
	at org.apache.commons.beanutils.BeanUtils.setProperty(
	at org.apache.commons.beanutils.BeanUtils.populate(
	at org.apache.struts.util.RequestUtils.populate(

Can anyone shed any light on what I am doing wrong, or can give me a 
piece of clear example code to show what I should be doing?


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

View raw message