Please I need help in using AdminFaces Admin template on netbean web application project. I have been battling on using it and I don't know what should be in the XML and other things. thanks
1 Answers
First add the AdminFaces jars on your project Libraries:
Note that if you don't use PrimeFaces extensions just remove it, as well as commons-lang3 (extensions dependency).
Also if you run the project in a servlet container like Tomcat you'll need to add CDI and JSF implementations like mojarra and weld to your classpath as well as JPA and EJB api (no need for implementations on these last two). Following are the libs for a Tomcat 9.x project on OpenBeans (see project link below):
After that on your web.xml enable the admin
theme, font-awesome
and mime-types
:
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>admin</param-value>
</context-param>
<context-param>
<param-name>primefaces.FONT_AWESOME</param-name>
<param-value>true</param-value>
</context-param>
<mime-mapping>
<extension>ico</extension>
<mime-type>image/x-icon</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff2</extension>
<mime-type>application/font-woff2</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/font-sfnt</mime-type>
</mime-mapping>
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>otf</extension>
<mime-type>font/opentype</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
After that your components will be styled like admin-theme and you'll be able to use the admin template on your page. See documentation for usage details.
Following is a sample NetBeans project with AdminFaces configured: https://github.com/rmpestano/admin-starter-netbeans

- 838
- 1
- 8
- 17
-
1A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why itβs there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) β Papershine May 13 '18 at 11:48
-