Hi
    Seems that you have a List of player objects. If so then indexed bean
properties might help. Your form will contain something like the following.

    public void setPlayerList(ArrayList playerList){
        this.playerList = playerList;
    }

    public ArrayList getPlayerList(){
        return playerList ;
    }

    public void setPlayer(int index, Player player){
        playerList .add(index, player);
    }

    public Player getPlayer (int index){
        return (Player)playerList .get(index);
    }

Read the doc. for the JSP portion of the solution.

One more solution is the nested tag. I've used nested beans for multiple
levels of nesting. It is so cool.

Mohan
-----Original Message-----
From: Eric Chow [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 8:25 AM
To: Struts Users Mailing List
Subject: array property in ActionForm ???


Hello,

<html:form action="/myaction.do">
    <html:text property="player"/>
    <html:text property="player"/>
    <html:text property="player"/>
    <html:text property="player"/>
    <html:text property="player"/>

    <html:submit/>
</html:form>

In the above JSP, there are five TEXT form field with the same name
"player", how can I design my ActionForm code for this case?

I tried,

public void setPlayer(int[] player) {
   this.player = player;
}

public int[] getPlayer() {
   return player;
}

But it seems not working !!!


Best regards,
Eric


==========================
If you know what you are doing,
it is not called RESEARCH!
==========================


---------------------------------------------------------------------
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]

Reply via email to