如何将 Font Awesome 4.3.0 与 JSF 集成?
How can I integrate Font Awesome 4.3.0 with JSF?
我已经尝试过这个方法:
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.
我愿意接受任何其他将 font-awesome 打包到我的 Web 应用程序中的建议(我不能使用 CDN 版本)。
如果你使用的是最新的webjars font-awesome 版本,则无需配置。通过 maven 或直接将 jar 添加到您的项目中,它就可以正常工作。只需确保包含正确的 css
<h:outputStylesheet library="webjars" name="font-awesome/4.3.0/css/font-awesome-jsf.css" />
我已经尝试过这个方法:
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.
我愿意接受任何其他将 font-awesome 打包到我的 Web 应用程序中的建议(我不能使用 CDN 版本)。
如果你使用的是最新的webjars font-awesome 版本,则无需配置。通过 maven 或直接将 jar 添加到您的项目中,它就可以正常工作。只需确保包含正确的 css
<h:outputStylesheet library="webjars" name="font-awesome/4.3.0/css/font-awesome-jsf.css" />