Example usage for org.springframework.web.servlet DispatcherServlet setDetectAllViewResolvers

List of usage examples for org.springframework.web.servlet DispatcherServlet setDetectAllViewResolvers

Introduction

In this page you can find the example usage for org.springframework.web.servlet DispatcherServlet setDetectAllViewResolvers.

Prototype

public void setDetectAllViewResolvers(boolean detectAllViewResolvers) 

Source Link

Document

Set whether to detect all ViewResolver beans in this servlet's context.

Usage

From source file:org.lightadmin.core.config.LightAdminWebApplicationInitializer.java

private void registerLightAdminDispatcher(final ServletContext servletContext) {
    final AnnotationConfigWebApplicationContext webApplicationContext = lightAdminApplicationContext(
            servletContext);//from  ww w . j  a  v a  2  s. co m

    final DispatcherServlet lightAdminDispatcher = new DispatcherServlet(webApplicationContext);
    lightAdminDispatcher.setDetectAllViewResolvers(false);

    ServletRegistration.Dynamic lightAdminDispatcherRegistration = servletContext
            .addServlet(LIGHT_ADMIN_DISPATCHER_NAME, lightAdminDispatcher);
    lightAdminDispatcherRegistration.setLoadOnStartup(3);
    lightAdminDispatcherRegistration.addMapping(dispatcherUrlMapping(lightAdminBaseUrl(servletContext)));
}

From source file:org.springframework.boot.actuate.autoconfigure.EndpointWebMvcChildContextConfiguration.java

@Bean(name = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
public DispatcherServlet dispatcherServlet() {
    DispatcherServlet dispatcherServlet = new DispatcherServlet();
    // Ensure the parent configuration does not leak down to us
    dispatcherServlet.setDetectAllHandlerAdapters(false);
    dispatcherServlet.setDetectAllHandlerExceptionResolvers(false);
    dispatcherServlet.setDetectAllHandlerMappings(false);
    dispatcherServlet.setDetectAllViewResolvers(false);
    return dispatcherServlet;
}