Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DaanVanYperen opened this issue May 20, 2024 · 0 comments
Open

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

DaanVanYperen opened this issue May 20, 2024 · 0 comments

Comments

@DaanVanYperen
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant