On 12 Oct 2004 16:13:43 +0800, Sebastian Ho <[EMAIL PROTECTED]> wrote: > Does anyone has an example using struts iterate? How does indexId works? > > Sebastian
Here's an example. I have a list "dataStoreList" in the request scope that I set via "request.setAttribute("dataStoreList",dataStoreList)" in my action class. Then in the jsp I use the logic:iterate to loop through and display the rows of the table. name - is the name of the variable, in this case dataStoreList scope - is where struts should look to find the variable id - is the name I'm going to give to my variable for use within the rest of the logic code Lee <logic:iterate id="element" name="dataStoreList" scope="request" type="com.sbc.netrics.struts.database.DataStore" > <tr> <td> <a href="./dataStoreCRUD.do?method=editForm&dataStoreId=<bean:write name="element" property="dataStoreId" />"><bean:write name="element" property="dataStoreName" /></a> </td> <td><bean:write name="element" property="dataStoreDescription" /></td> </tr> </logic:iterate> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]