struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: logic:iterate tag!
Date Thu, 08 Mar 2007 23:11:20 GMT
Swaminathan Subramanian wrote:
> All,
>         I am working on application using Struts 1.0. I am trying to display an ArrayList
of complex objects using the logic:iterate tag.
>         Here's some more details - 
>         FileObj
>          fileName
>          fileSize
>          fileType
>          fileModifiedDate
>         Action class
>         FileObj[] objFiles = null;
>         objFiles = intf.getFiles(ctx, filename);
>         I tried several approaches as mentioned in different posts but I am not able
to display this ArrayList of FileObjects. If somebody could outline a list         of steps
to be followed to do this, I would apprecuate it.
> Thanks in advance!
> -SS

Well, you'll need to expose the objFiles property to the JSP somehow (by 
putting it in request/session scope, or in your form bean, for example). 
Asuming you've done that, and that you have appropriate getters on your 
FileObj, you can access it like this:

<logic:iterate id="file" name="yourFileObjRef">
     <bean:write name="file" property="fileName"/>


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message