-
Couldn't load subscription status.
- Fork 41.6k
Closed
Description
Currently AbstractServletWebServerFactory is registering the default Servlet in all cases.
With a typical Spring Boot application:
- embedded server
- no JSPs
DispatcherServletmapped on"/"- static resources being served from the classpath (not "WEB-INF")
The default Servlet doesn't seem to be used at all.
Moreover, to use that Servlet, developers need to configure Spring MVC to enable forwarding requests to the default Servlet if no Handler processed the request:
@EnableWebMvc
@Configuration(proxyBeanMethods = false)
public class WebConfig implements WebMvcConfigurer {
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
}
In this case I think we could create a new configuration property to enable/disable the registration of the default Servlet and maybe switch the default to false here?
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement