There's load of examples in the archives. Have a look.
On 12 Mar 2004, at 09:48, Mu Mike wrote:
Mark I did as you wrote
<form-bean name="TestBeanForm" type="com.mycom.form.TestBeanForm"/>
in jsp file:
<html:form action="/testAction.do">
<logic:iterate name="TestBeanForm" property="testBean" id="mybean1" indexId="index1">
<html:text name="mybean1" property="string1" indexed="true"/>
</logic:iterate>
<html:submit property="submitValue">Submit Changes</html:submit>
</html:form>
it says "no collection found"
I then changed the jsp file to this
<html:form action="/testAction.do">
<logic:iterate name="TestBeanForm" property="testBean" id="mybean1" indexId="index1">
<html:text name="mybean1" property="testBean" value="string1" indexed="true"/>
</logic:iterate>
<html:submit property="submitValue">Submit Changes</html:submit>
</html:form>
it still reports "no collection found"
Thanks&Regards
From: Mark Lowe <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: Re: submit an arraylist Date: Fri, 12 Mar 2004 09:35:11 +0100
The name in the iterate tag needs to match the name you've using to define the form bean in struts-config
<form-bean name="testForm" type="com.mike.struts.TestBeanForm" />
<html:form action="/testAction.do"> <logic:iterate id="mybean" name="testForm" property="testBean"> <html:text name="mybean" property="string1" indexed="true" /> ...
On 12 Mar 2004, at 09:23, Mu Mike wrote:
I write this in jsp file,but it failed
<html:form action="/testAction.do">
<logic:iterate name="TestBeanForm" property="testBean" id="mybean1" indexId="0">
<html:text property="testBean" value="string1" />
</logic:iterate>
<html:submit property="submitValue">Submit Changes</html:submit>
</html:form>
is my jsp code right?
From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: submit an arraylist
Date: Fri, 12 Mar 2004 07:55:33 +0000
I have a form as the below
TestBeanForm.java public class TestBeanForm extends ActionForm { public ArrayList getTestBean() {
if(testBean==null) testBean=new ArrayList(); return testBean; }
public void setTestBean(ArrayList testBean) { this.testBean = testBean; }
private ArrayList testBean;
}
how should I write in my configruatio file using logic:iterate to submit values for my ArrayList testBean?
_________________________________________________________________ ~{Cb7QOBTX~} MSN Explorer: http://explorer.msn.com/lccn/
-------------------------------------------------------------------- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________ ~{Cb7QOBTX~} MSN Explorer: http://explorer.msn.com/lccn/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________ 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]