Enabling Fontawesome icons in Primefaces

I’ve tested this in the Primefaces 6.0 and JSF 2.2 configuration

https://www.primefaces.org/showcase/ui/misc/fa.xhtml

http://fontawesome.io/cheatsheet/

Before

After

web.xml  

<context-param>
        <param-name>primefaces.FONT_AWESOME</param-name>
        <param-value>true</param-value>
</context-param>
<mime-mapping>
 <extension>woff2</extension>
 <mime-type>application/x-font-woff2</mime-type>
</mime-mapping>

jsf page  

<p:column headerText="Actions">
                        <p:commandButton type="button" value="Edit" icon="fa fa-fw fa-edit"/>
                        <p:commandButton type="button" value="Delete" icon="fa fa-fw fa-remove"/>
</p:column>

 

Leave a Reply

Your email address will not be published. Required fields are marked *