警告:JSF1091:找不到文件动态内容的MIME类型 [英] WARNING: JSF1091: No mime type could be found for file dynamiccontent
本文介绍了警告:JSF1091:找不到文件动态内容的MIME类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在日食下收到以下警告:
I get the following warning under eclipse :
WARNING: JSF1091: No mime type could be found for file dynamiccontent. To resolve this, add a mime-type mapping to the applications web.xml
此错误是我发布图片时引起的
This error is caused when I post a picture
在primefaces作曲家之下:
below primefaces composant :
<p:graphicImage value="#{bean.image}"/>
Java Bean:
Java Bean :
private StreamedContent image;
// Getter
public StreamedContent getImage() {
try {
JFreeChart jfreechart = ChartFactory.createPieChart3D("",
createDataset(), true, true, false);
PiePlot3D plot = (PiePlot3D) jfreechart.getPlot();
File chartFile = new File("dynamichart");
ChartUtilities.saveChartAsPNG(chartFile, jfreechart, 375, 300);
chartImage = new DefaultStreamedContent(new FileInputStream(
chartFile), "image/png");
return chartImage;
} catch (Exception e) {
e.printStackTrace();
return new DefaultStreamedContent();
}
}
// generate data for image
public static PieDataset createDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("A",10);
dataset.setValue("B", 11);
dataset.setValue("C", 80);
dataset.setValue("D", 12);
return dataset;
}
推荐答案
我找到了一个解决方案.
I found one solution.
使用最新版本的Primefaces(3.5).
by using the latest version of primefaces (3.5).
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.5</version>
</dependency>
但是IHM会有令人不愉快的变化
but there will unpleasant changes in IHM
这篇关于警告:JSF1091:找不到文件动态内容的MIME类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文