Alright, I've completely simplified my code to the bare-bones, have tried
following the iterate examples provided by the kind souls who have posted
example code, but I can not for the life of me get <logic:iterate> and
<html:text> working together.

  I do have the <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
tag in my JSP.

  I am using the October 17th nightly build of struts.jar.

  The ActionForm bean, defined in my struts-config.xml as
tournamentPlayersForm, in session scope:
    private Vector mUserList = new Vector();

    public Vector getUserList()
    {
        return( mUserList);
    }

    public void setUserList( Vector userList )
    {
        mUserList = userList;
    }

    public FormUser getUser( int index )
    {
        return ( FormUser ) mUserList.elementAt( index );
    }

  ...mUserList contains a vector of easy-to-swallow FormUser objects:
    private String mUserName = null;

    public String getUserName()
    {
        return mUserName;
    }

    public void setUserName( String value )
    {
        mUserName = value;
    }

  The JSP in question:
    <logic:iterate id="userLoop" name="tournamentPlayersForm"
property="userList" type="com.sabertooth.FormUser" scope="session">
      <html:text name="userLoop" indexed="true" property="userName"
size="20" maxlength="75"/>
    </logic:iterate>

  When the JSP initially loads, it properly displays the number of textboxes
based on the size of mUserList and even fills them in with userNames if the
userName values were previously populated.  However, when I retrieve the
same vector after this JSP is submitted, the userNames never get populated
with the values entered into the <html:text> boxes.  When I view source,
they appear as so:
    <input type="text" name="userLoop[0].userName">
    <input type="text" name="userLoop[1].userName">
    <input type="text" name="userLoop[2].userName">

  Andrew van der Voort (bless this man for posting code snippets) posted his
way to get it working which I've tried but unfortunately had the same
results - having the same setUserName method normally used in my FormUser
object and put it into the form itself taking a String[] as an argument,
then on the validate() event of my ActionForm go through the member variable
I assigned the String[] to and pull the names out that way.  This String[]
never gets populated either.

  I've tried every possible combination of tags, I've followed everyone
else's example of how to get iterate working, and I'm still looking at null
userNames.

  Help?

  - John

Reply via email to