我已经尝试过这个方法:
如何将 webjars.org 中的 Font Awesome 与 JSF 结合使用 https://stackoverflow.com/questions/18891768/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:数据导出器(我认为这与p:数据导出器)
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" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)