I have been thinking of this for weeks, but still don't know if the index properties will help or not.
Here are my application requirements, and any suggestions are needed, thanks.
This project needs to display a lot of data on a jsp page, the row number is fixed what I mean fixed is it depends on the data in database so I won't be able to hardcode them. But the columns are dynamic, user could add as many columns as they want.
For example here is the structure of 5 rows by 2 columns:
Yes, indexed properties will work well in this situation. There are many ways to do this, but here's one suggestion:
Create a javaBean called Case or something like that which has properties for all the fields you listed (client, matter, etc.). In your ActionForm, create a collection of these beans called cases.
Then in your jsp, use indexed properties along with logic:iterate to produce the output. Something like this: <tr> <td>client:</td> <logic:iterate id="case" name="myForm" property="cases" indexId="i"> <td><html:text property='<%="cases["+i+"].client" %>' /></td> </logic:iterate> </tr> <tr> <td>matter:</td> <logic:iterate id="case2" name="myForm" property="cases" indexId="i2"> <td><html:text property='<%="cases["+i2+"].matter" %>' /></td> </logic:iterate> </tr>
I will try it this way to see if I can get it working, because I won't be able to know the properties until I query the database, so how am I able to set up all the set and get properties. Maybe I can use a list, not sure.