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
below primefaces composant :
<p:graphicImage value="#{bean.image}"/>
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;
}
Try adding the following to your web.xml file
Although I post this answer after a while probably it will be useful for other developers who face this problem.
To avoid that annoying warning from above add the following code into your web.xml :
For more details please check:
http://blog.eisele.net/2011/01/weblogic-10340-oepe-maven-primefaces.html
I just want to share my experience with a similar problem, I use
maven
,netbeans
andpayara
. Once I had this warning:The solution to remove this warning was adding the following code to the
web.xml
:Note: I had the same warning with different files, those files had different extensions (
woff, eot, woff2 and ttf
). The solution to this was to replacewoff
in<extension>
with one of the extensions previously mentioned.I hope that my answer will help someone someday.
PS : I found the solution in this page.
I had the JSF1091 warning for
http://example.org
andjavascript:;
as well, with Icefaces instead of Primefaces.Changing
to
silenced the warning about
javascript:;
.Changing
to
fixed it for the URL.
I found one solution.
by using the latest version of primefaces (3.5).
but there will unpleasant changes in IHM
if you have spring you can also have (I added most of fa-Icons):