3
votes

I am using MaterialAdmin theme for a JSF/PrimeFaces web application.

Every time I launch the app I get this warning for every single .less file:

WARNING: JSF1091: No mime type detected for shared / variables.less file. To resolve this issue, add a mime-type mapping to the web.xml file of the application.

I tried this but no chance :

<web:mime-mapping>
    <extension>less</extension>
    <web:mime-type>text/plain</web:mime-type>
</web:mime-mapping>
1

1 Answers

5
votes

Provided a web.xml whose root declaration is as per standard Servlet 3.1 spec like below (note: no xmlns:web XML namespace!),

<?xml version="1.0" encoding="UTF-8"?>
<web-app
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1"
>
    <!-- Config here. -->
</web-app>

Then you should be adding the below entry in order to associate the less extension with the text/css mime type (note: no text/plain!):

<mime-mapping>
    <extension>less</extension>
    <mime-type>text/css</mime-type>
</mime-mapping>

Don't forget to rebuild/redeploy/restart. The web.xml is parsed only once on application's startup.