You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to this, MimeMappings does not contain the Web Fonts Mime Types declaration.
When using Font Awesome and Bootstrap, my application generates this warnings :
JSF1091: No mime type could be found for file font-awesome/4.6.2/fonts/fontawesome-webfont.eot. To resolve this, add a mime-type mapping to the applications web.xml.
JSF1091: No mime type could be found for file bootstrap/3.3.6/fonts/glyphicons-halflings-regular.ttf. To resolve this, add a mime-type mapping to the applications web.xml.
Here is my current workaround :
@Component
public class ServletCustomizer implements EmbeddedServletContainerCustomizer {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
mappings.add("woff", "application/font-woff");
mappings.add("woff2", "application/font-woff2");
mappings.add("ttf", "application/x-font-truetype");
mappings.add("eot", "application/vnd.ms-fontobject");
mappings.add("svg", "image/svg+xml");
mappings.add("otf", "application/x-font-opentype");
container.setMimeMappings(mappings);
}
}
Configuration :
Spring Boot 1.4.0.M3 with Embedded Tomcat
Primefaces 5.3 / Majorra 2.2.13
Webjars for bootstrap 3.3.6
Webjars for font-awesome 4.6.2
The text was updated successfully, but these errors were encountered:
We need to draw the line somewhere as each mapping that we configure has a small cost so we configure the three embedded containers that we support (Tomcat, Jetty, and Undertow) with the union of the mime mappings that each of those containers provides by default. Put another way, none of the supported containers provides a mapping for eot or ttf by default so Spring Boot doesn't either.
Uh oh!
There was an error while loading. Please reload this page.
Similar to this, MimeMappings does not contain the Web Fonts Mime Types declaration.
When using Font Awesome and Bootstrap, my application generates this warnings :
Here is my current workaround :
Configuration :
Spring Boot 1.4.0.M3 with Embedded Tomcat
Primefaces 5.3 / Majorra 2.2.13
Webjars for bootstrap 3.3.6
Webjars for font-awesome 4.6.2
The text was updated successfully, but these errors were encountered: