0

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

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
T.Gold
  • 31
  • 5
  • What PrimeFaces AdminLTE template? There is no such template from PrimeFaces... it is for/from adminfaces – Kukeltje Sep 14 '17 at 15:43

1 Answers1

0

First add the AdminFaces jars on your project Libraries:

enter image description here

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):

enter image description here

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

rmpestano
  • 838
  • 1
  • 8
  • 17
  • 1
    A 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
  • Just updated the url and now it's pointing to a github project, – rmpestano Jan 26 '20 at 22:25