It's cool I solved the problem, basically if I place a counter in the nested:iterate tag, I can add a paramater like index=<%=count%> to the URL and the browser treats it as a completely different image.
Regards Steve -----Original Message----- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Tuesday, 11 March 2003 12:35 PM To: Struts User Mailing List Subject: Dynamic Image Loading from ByteArray Hi there, here is what I am trying to do. A user can select to upload two image that will eventually get stored into the databasa. Now rather than write them to files in a tmp directory, which could potentially get messy, I want to be able to display in my images from the byte array that the FormFile gives me. I have read around and workedout that the best way is to either point src attribute of the image tag to a jsp or servlet action. Both work for one image, but if I try to display multiple images dynamically, ther is an error, and it jsut diplay the first image several times. Here's how my code works. a logic:iterate tag, cycles through the images that have been uploaded, in the form of a bean whose file field is of type com.crm.upload.FormFile for each one, it adds it to an arraylist in session. and write a <img src="http://localhost:9080/CRMSoftwareApp/loadImage.do?attribute=IMG_TEMPLAT E_BEAN"> for each image, to display what has been uploaded. now the loadImage action, takes the attribute, retrieves the ArrayList from session at that attribute. Remove the first element from the ArrayList, then, using the Response.Outputstream, writes the image data. o = response.getOutPutStream() o.write(FormFile.getFileData()); then returns success and exits the action. The idea is that each time this is called, the image at the top of the ArrayList will be written out to the page. The problem I am having is that the first image is getting displayed, without a problem. But the action is not getting called again, I suspect that the browser sees that <img src="http://localhost:9080/CRMSoftwareApp/loadImage.do?attribute=IMG_TEMPLAT E_BEAN"> matches the previous one, so instead of calling loading the url again, it just redisplays what it has already loaded. Can anyone sugges a way to get around this?? Steve --------------------------------------------------------------------- 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]