use of org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory in project spring-boot by spring-projects.
the class ServletWebServerFactoryCustomizerTests method testCustomizeJsp.
@Test
void testCustomizeJsp() {
ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
this.customizer.customize(factory);
then(factory).should().setJsp(any(Jsp.class));
}
use of org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory in project jhipster-registry by jhipster.
the class WebConfigurer method setMimeMappings.
private void setMimeMappings(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
servletWebServer.setMimeMappings(mappings);
}
}
Aggregations