Hi everyone,
I'm writing a simple portlet to display an image from a binary image.
However, what I get from the portlet is all binary data. This is what I have
done:
response.setContentType("image/gif");
OutputStream outStream = response.getPortletOutputStream();
byte image[] = null;
try {
image = getImage();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
outStream.write(image);
outStream.flush();
and this is my portlet.xml
<portlet>
<portlet-name>Image</portlet-name>
<display-name>Image Portlet</display-name>
<portlet-class>
org.apache.ws.axis2.ImageGetter
</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supports>
<mime-type>image/gif</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Image Title</title>
</portlet-info>
</portlet>
Could anyone please help me out of this.
Thank you so much.
--
View this message in context:
http://www.nabble.com/Problem-with-display-binary-image-in-portlet-tf3879263.html#a10993320
Sent from the Pluto - User mailing list archive at Nabble.com.