You could use a DynaActionForm that contains a property of type ArrayList ...

Something like...

   <form-bean name="bookForm" type="org.apache.struts.action.DynaActionForm">
                <form-property name="books" type="java.util.ArrayList"/>
   </form-bean>

This arraylist can contain DynaBeans inside it and you can access these from your 
Struts based JSP

<logic:iterate name="bookForm" property="books" id="book">    
      <bean:write name="book" property="author"/>
      <bean:write name="book" property="title"/>
      <bean:write name="book" property="domain"/>
</logic:iterate>  

Struts handles DynaActionForms & typical Action forms seamlessly..However DynaBeans 
and Custom beans should not be mixed up..


Sumit

-----Original Message-----
From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 4:17 PM
To: Struts Users Mailing List
Subject: Dynamic bean in a result list


Hi,
I have a jsp page where I must diplay a list of results like this
<logic:present  name="DOCUMENTS">
    <logic :iterate id='laliste' name='DOCUMENTS'>

       <tr>

           <td><bean :write name='liste' property='author'></td>

           <td><bean :write name='liste' property='title'></td>

           <td><bean :write name='liste' property='domain'></td>

       </tr>

    </logic :iterate>

   </logic:present>

</logic :present>

DOCUMENTS is an Array List which contains JavaBeans. The thing is that I want to
use a dynamic JavaBean, so I could have an ArrayList of objects like this
public class DynamicOT implements Serializable{

private HashMap property;


public DynamicOT(){

property = new HashMap();

}

public void setProperty(String nm, String val){

property.put(nm,val);

}

public String getProperty(String nm){

String str = (String) property.get(nm);

return str;

}

}

But then how could I retrive them in my jsp page ?
Using
 <td><bean :write name="liste" property="property('author')"></td>
would be enough?

Has anyone an idee of how I could do this ?

Thanx in advance,
Ovidiu


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