you need to create a class images

public class image{
    String pix;
    int hieght;
    int width;
//setters and getters
}

In your action class you create an arraylist;

ArrayList pics= new ArrayList();
//loop
   image img=new image;
   //set the image values;

   pics.add(img);
//endloop
Once your arraylist is built om images store it in the ActionForm.
ActionForm.setImages(pics);

Then on the JSP you need to iterate

<logic:iterate id="somename"  name="ActionForm" type="image" 
property="images">
<bean:write  name="somename" property ="pix"/>
<bean:write  name="somename" property ="hieght"/>
<bean:write  name="somename" property ="width"/>
</logic:iterate>


>From: "chiji nwankwo" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Itetaring over an array list of bean values
>Date: Tue, 02 Oct 2001 14:50:33 +0000
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--- Begin Message ---

Hi,

I have a bean that encapsulates the properties needed to render an image (border, height, width etc).

I want to able to use the values stored in this bean as attribute values for the struts img tag.

Eg

ArrayList images = new ArrayList();

images.add( new Image( "pix", "22", "43" ) );
images.add( new Image( "pix", "22", "43" ) );
images.add( new Image( "pix", "22", "43" ) );

.    .    .    .     .    .    .    .

I then want to do the following

<logic:iterate ...name="images" id="img". .. ..>

     <html:img name=?? height=?? width=?? />

</logic:iterate>

I do have the array list stored in a scope that my jsp page can acess. I don't know if this is possible.

Thanks

Chiji



 


 


 



Get your FREE download of MSN Explorer at http://explorer.msn.com
--- End Message ---

Reply via email to