I'm using streamedcontent to render a byte sent from JSF then send it back as a streamed content as following:
<p:graphicImage value="#{manage.bytesToStreamedContent(car.image)}"/>
where image is the byte array of the image stored in the database
backing bean:
public StreamedContent bytesToStreamedContent(byte[] bytes)
{
InputStream is = new ByteArrayInputStream(bytes);
StreamedContent image = new DefaultStreamedContent (is, "image/jpeg");
return image;
}
But I'm not getting the image in the JSF page. I got this message appearing in the server log:
WARNING: JSF1091: No mime type could be found for file dynamiccontent. To resolve this, add a mime-type mapping to the applications web.xml.
and:
SEVERE: Error in streaming dynamic resource.
can you please help me out here, I cant find any useful info regarding this issue
PS:
Im using the following libraries:
Mojarra 2.1.3
PrimeFaces 3.1.1
Glassfish 3.1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…