class MyActionForm
{
  private static final MAX_ENTRIES = 50;
  private String[] text;

  public MyActionForm()
  {
    text = new String[MAX_ENTRIES];
  }

  public String[] getText() {return text;}

  public void setText(int index, String newText) {text[index] = newText;}
}

my.jsp
<html:html>
  <body>
    <html:form action="MyAction.do">
      Label 1:<html:text property="text[0]"/><br/>
      Label 2:<html:text property="text[1]"/><br/>
      <html:submit/>
    </html:form>
  <body>
</html:html>


Gary Kephart                    | New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]               | 340 Commerce
949-797-5660                    | Irvine, CA  92602-1318


> -----Original Message-----
> From: David Thielen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 3:46 PM
> To: Struts-Users
> Subject: Help please - indexed field in ActionForm
> 
> 
> Hi;
> 
> I've been fighting this all day with no luck. And it has to 
> be a simple thing to do.
> 
> I have a form where I have N lines in it. Each line needs to 
> have some text displayed and an edit box.
> 
> How do I set this up in the .jsp file and in the ActionForm? 
> I've found a number of examples on the web but they all have 
> incomplete code and my guesses for the rest of the code have 
> not been right so far.
> 
> thanks - dave
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to