Skip to content

What is the recommended way to configure mime types?  #1071

@DaanVanYperen

Description

@DaanVanYperen

When I run this example project with embedded tomcat and project-stage: Development I get the following error for all resources:

 JSF1091: No mime type could be found for file /index.xhtml.  To resolve this, add a mime-type mapping to the applications web.xml.

I can work around it using a WebServerFactoryCustomizer. MimeMappings.DEFAULT provides no mime types so i'm not sure if that is the recommended way to solve it in joinfaces.

@Component
public class MimeMappingCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {

    @Override
    public void customize(TomcatServletWebServerFactory factory) {
        MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
        mappings.add("xhtml", "application/xhtml+xml");
        factory.setMimeMappings(mappings);
    }
}

What is the recommended way to configure mime types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions