如何将Font Awesome 4.3.0与JSF集成?

时间:2015-02-20 20:36:03

标签: jsf-2 font-awesome

我已经尝试过这种方法:

How to use Font Awesome from webjars.org with JSF

它实际上很棒。问题是将omnifaces UnmappedResourceHandler配置为资源处理程序会破坏我的其他JSF库组件:

faces-config.xml:

<application>
    <resource-handler>org.omnifaces.resourcehandler.UnmappedResourceHandler</resource-handler>
</application>

当我尝试使用 ace:dataExporter 时(我认为它与 p:dataExporter 相同)

webpage.xhtml: 

<ace:dataExporter target="dataTable" fileName="data" type="csv"/>  

什么都没有导出,我在glassfish日志中得到以下内容:

Warning: JSF1091: No mime type could be found for file s01a3dc15-c480-4769-a71a-bc08f191416f.  To resolve this, add a mime-type mapping to the applications web.xml.
Warning: JSF1091: No mime type could be found for file 71a-bc08f191416f.  To resolve this, add a mime-type mapping to the applications web.xml.

我愿意接受任何其他建议,将字体 - awesome打包到我的网页应用程序中(我不能使用CDN版本)。

1 个答案:

答案 0 :(得分:2)

如果您使用最新的webjars font-awesome版本,则无需配置。通过maven或直接将jar添加到项目中,它就可以正常工作。只需确保包含正确的CSS

<h:outputStylesheet library="webjars" name="font-awesome/4.3.0/css/font-awesome-jsf.css" />