0

I am using jsf and adminlte theme. i am having troubles with icons

my css part:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&amp;display=fallback"/>
<h:outputStylesheet library="plugins/fontawesome-free/css" name="all.min.css" />
<h:outputStylesheet library="dist/css" name="adminlte.min.css" />

 my js part:

<h:outputScript library="plugins/jquery" name="jquery.min.js"/>
<h:outputScript library="plugins/bootstrap/js" name="bootstrap.bundle.min.js"/>
<h:outputScript library="dist/js" name="adminlte.min.js"/>

this is console errors

fa-solid-900.woff2:1 Failed to load resource: the server responded with a status of 404 ()
fa-regular-400.woff2:1 Failed to load resource: the server responded with a status of 404 ()
fa-solid-900.woff:1 Failed to load resource: the server responded with a status of 404 () 
fa-regular-400.woff:1 Failed to load resource: the server responded with a status of 404 () 
fa-solid-900.ttf:1 Failed to load resource: the server responded with a status of 404 ()
fa-regular-400.ttf:1 Failed to load resource: the server responded with a status of 404 ()

that is the failed data path which i get from console http://localhost:8080/WebApplication1/faces/template/tryout.xhtml#

 ​can not see the problem. tried to change all.min.cs's inside like ../webfonts -> /webfonts did not work.

1 Answers1

0

Make sure you set the correct MIME types for WOFF fonts in your web server..

Web.config (IIS):

<configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".woff" mimeType="font/woff" />
      <mimeMap fileExtension=".woff2" mimeType="font/woff2" />
    </staticContent>
  </system.webServer>
</configuration>

.htaccess (Apache):

AddType font/woff .woff
AddType font/woff2 .woff2
Henkans
  • 11
  • 2
  • Hey, thank you for your answer. I added web.config part but could not figure out how to add apache part. Read and watched something but i am not sure how to do that. By using .htaccess? – Deivid Crathle Sep 14 '21 at 20:38
  • Exactly, if use use apache web server you add it in .htaccess. But you don´t use the web.config part. If you use IIS web server you either change directly in IIS or add the config part in Web.config. – Henkans Sep 15 '21 at 07:22