struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin HaleBoyes <>
Subject repeating input fields
Date Mon, 14 Oct 2002 14:53:47 GMT
I know this has been asked before but I'm unable to find anything
in the archive - probably not using the right search terms...

I'm trying to create a form that allows the user to input a list
of strings.  Kind of like a detail block (of a master-detail

So I have

  public class LoanPurpose {
    private String id;
    private String description;
    public String getId() {return id;}
    public void   setId( String v ) { id = v; }
    public String getDescription() {return description;}
    public void   setDescription( String v ) {description = v;}

and a Form bean

  public class LoansForm extends ActionForm {
    private LoansPurpose[] purposes = null;
    public LoanPurpose[] getPurposes() {return purposes;}
    public void setPurposes( LoanPurpose[] v ) {purposes = v;}
    public void reset(ActionMapping mapping,
               HttpServletRequest request) {purposes = null;}

In my JSP form I have:

<html:form action="/saveLoanPurps" method="post">
<logic:iterate id="p" name="LoansForm" property="purposes">
      <html:text name="p" property="id" size="15"/>
      <bean:write name="p" property="description" filter="true"/>

If I stuff a few values into the purposes array in the "edit"
action they properly get displayed when the form is rendered.

This is where I get lost though.  When I hit the "Save" submit
button I don't get the results I expect.  In the Save action I
print the contents of the LoansForm.purposes array and it is null,
instead of having the contents of the input fields.

What am I missing?

Any help would be most appreciated.

Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More

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

View raw message