1

有没有办法摆脱这些警告?是什么意思file ""。我已经在 web.xml 下面添加了

00000030 context       W   JSF1091: No mime type could be found for file "".  
To resolve this, add a mime-type mapping to the applications web.xml.

web.xml

<mime-mapping>
    <extension>gif</extension>
    <mime-type>image/gif</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>jpeg</extension>
    <mime-type>image/jpeg</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>jpg</extension>
    <mime-type>image/jpeg</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>png</extension>
    <mime-type>image/png</mime-type>
</mime-mapping>
<mime-mapping> 
     <extension>xml</extension> 
     <mime-type>application/xml</mime-type> 
</mime-mapping>
4

1 回答 1

1

大概为时已晚,但我最近遇到了同样的问题。

在您加载图像的控制器中,您必须放置一个指向它的文件名的链接。

IE

<p:graphicImage value="#{displayImage.file}" **name="#{image.filename}"** alt="Image Description for #{image.description}" stream="true" title="#{image.copyrightnote}">

希望能帮助到你。干杯甘

于 2017-03-15T10:52:28.097 回答