I'm setting up a project from scratches, currently I'm on step of configuring Spring MVC 4.1.5 using java config. The whole app is beeing run on tomcat gradle plugin.
Can someone explain me why I need to make the following call to the class DefaultServletHandlerConfigurer in order to make requests map to my controllers ?
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
Without enabling it all my requests are beeing rejected and server says there is no mapping for particular request.
I read spring doc to find out, but the description doesn't tell me too much.
Enable forwarding to the "default" Servlet. When this method is used the DefaultServletHttpRequestHandler will try to auto-detect the "default" Servlet name. Alternatively, you can specify the name of the default Servlet via enable(String).