Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Multiple Images / InputStream

Euphreme Rinfrett

2008-08-14

Replies: Find Java Web Hosting

Author LoginPost Reply

I'm using Struts 2.0.11 release.

Within my JSP page, I'm displaying a list of elements which all have an
image. Those images are displayed using an action with stream result.
In Firefox, everything works fine, in IE 7.0, all images shown are the same,
I didn't have a chance to take a look with IE 6.0.

Was not able to find anything in the wiki or forums about this.

In my JSP:

<s:url id="imageUrl" action="displayExerciceImageAction">
<s:param name="model.id">
 <s:property value="id"/>
</s:param>
</s:url>
<s:property value= " alt="<s:text name="exercice.form.image.alt"/>"
class="exerciceImg"/>

In my struts.xml

<action name="displayExerciceImageAction" class="displayExerciceAction">
<result name="success" type="stream">
 ${model.imageContentType}
 inline;filename="${model.name}"
 ${model.image.length}
</result>
</action>

In my action :

 /**
  * @return The image itself.
  */
 public InputStream getInputStream() {
    return new ByteArrayInputStream(model.getImage());
 }


--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.