'Mime mapping in domain.xml (Wildfly)

I'm trying to use the mime-mapping element in domain.xml, but it doesn't seem to work. I need to change the behaviour of an already-existing app, so that CSV files are opened by Excel.

The web.xml file, as already deployed, contains the following:

<mime-mapping>
    <extension>csv</extension>
    <mime-type>text/csv</mime-type>
</mime-mapping>

I was hoping to add this to domain.xml, to override the older setting, but it still doesn't work.

        <servlet-container name="default">
            <jsp-config/>
            <session-cookie http-only="true" secure="true"/>
            <websockets/>
            <mime-mappings>
                <mime-mapping name="csv" value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
            </mime-mappings>
        </servlet-container>

I don't want to go down the path of using a deployment overlay, as I don't want to manage a whole new web.xml file.

Any ideas?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source