我使用streamedcontent呈現從JSF發送一個字節,然後發回的流媒體內容如下:graphicImage的在Primefaces
<p:graphicImage value="#{manage.bytesToStreamedContent(car.image)}"/>
其中圖像是存儲在圖像的字節數組數據庫
支持bean:
public StreamedContent bytesToStreamedContent(byte[] bytes)
{
InputStream is = new ByteArrayInputStream(bytes);
StreamedContent image = new DefaultStreamedContent (is, "image/jpeg");
return image;
}
但我沒有得到在JSF頁面圖像。我得到這條消息出現在服務器日誌中:
警告:JSF1091:文件dynamiccontent中找不到MIME類型。要解決此問題,請將mime-type映射添加到應用程序web.xml。
和:
SEVERE: Error in streaming dynamic resource.
可以請你幫我在這裏,我不能找到有關這個問題的任何有用的信息
PS:
進出口使用以下庫:
Mojarra 2.1.3
PrimeFaces 3.1.1
Glassfish 3.1
可能重複(http://stackoverflow.com/questions/10073905/problems-displaying-database-blob-image-in -primefaces-graphicimage) – BalusC 2013-06-27 11:49:57
相關/重複問題:http://stackoverflow.com/questions/8207325/display-image-from-database-with-pgraphicimage/,http://stackoverflow.com/questions/10073905/problems-顯示數據庫blob圖像在primefaces-graphicimage,http://stackoverflow.com/questions/10944673/how-to-use-pgraphicimage-with-defaultstreamedcontent-in-an-uirepeat/,http:// stackoverflow .com/questions/8304967/how-to-use-pgraphicimage-with-streamedcontent-within-pdatatable/ – BalusC 2013-06-27 11:51:03
@BalusC但這篇文章比你提到的一些「相關」問題還要舊! – fareed 2013-06-27 16:35:59