Java 类org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HttpMessageConverters.java   
private List<HttpMessageConverter<?>> getDefaultConverters() {
    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    if (ClassUtils.isPresent("org.springframework.web.servlet.config.annotation."
            + "WebMvcConfigurationSupport", null)) {
        converters.addAll(new WebMvcConfigurationSupport() {
            public List<HttpMessageConverter<?>> defaultMessageConverters() {
                return super.getMessageConverters();
            }
        }.defaultMessageConverters());
    }
    else {
        converters.addAll(new RestTemplate().getMessageConverters());
    }
    reorderXmlConvertersToEnd(converters);
    return converters;
}
项目:flowable-engine    文件:WebConfigurer.java   
protected ServletRegistration.Dynamic initSpringRestComponent(ServletContext servletContext, AnnotationConfigWebApplicationContext rootContext,
        String restContextRoot, Class<? extends WebMvcConfigurationSupport> webConfigClass) {

    LOGGER.debug("Configuring Spring Web application context - {} REST", restContextRoot);
    AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
    dispatcherServletConfiguration.setParent(rootContext);
    dispatcherServletConfiguration.register(webConfigClass);

    LOGGER.debug("Registering Spring MVC Servlet - {} REST", restContextRoot);
    ServletRegistration.Dynamic dispatcherServlet = servletContext.addServlet(restContextRoot + "-dispatcher", new DispatcherServlet(dispatcherServletConfiguration));
    dispatcherServlet.addMapping("/" + restContextRoot + "/*");
    dispatcherServlet.setLoadOnStartup(1);
    dispatcherServlet.setAsyncSupported(true);

    return dispatcherServlet;
}
项目:flowable-engine    文件:WebConfigurer.java   
protected ServletRegistration.Dynamic initSpringRestComponent(ServletContext servletContext, AnnotationConfigWebApplicationContext rootContext,
        String name, String restContextRoot, Class<? extends WebMvcConfigurationSupport> webConfigClass) {

    LOGGER.debug("Configuring Spring Web application context - {} REST", name);
    AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
    dispatcherServletConfiguration.setParent(rootContext);
    dispatcherServletConfiguration.register(webConfigClass);

    LOGGER.debug("Registering Spring MVC Servlet - {} REST", name);
    ServletRegistration.Dynamic dispatcherServlet = servletContext.addServlet(name + "-dispatcher", new DispatcherServlet(dispatcherServletConfiguration));
    dispatcherServlet.addMapping(restContextRoot + "/*");
    dispatcherServlet.setLoadOnStartup(1);
    dispatcherServlet.setAsyncSupported(true);

    return dispatcherServlet;
}
项目:spring-boot-concourse    文件:HttpMessageConverters.java   
private List<HttpMessageConverter<?>> getDefaultConverters() {
    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    if (ClassUtils.isPresent("org.springframework.web.servlet.config.annotation."
            + "WebMvcConfigurationSupport", null)) {
        converters.addAll(new WebMvcConfigurationSupport() {
            public List<HttpMessageConverter<?>> defaultMessageConverters() {
                return super.getMessageConverters();
            }
        }.defaultMessageConverters());
    }
    else {
        converters.addAll(new RestTemplate().getMessageConverters());
    }
    reorderXmlConvertersToEnd(converters);
    return converters;
}
项目:contestparser    文件:HttpMessageConverters.java   
private List<HttpMessageConverter<?>> getDefaultConverters() {
    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    if (ClassUtils.isPresent("org.springframework.web.servlet.config.annotation."
            + "WebMvcConfigurationSupport", null)) {
        converters.addAll(new WebMvcConfigurationSupport() {
            public List<HttpMessageConverter<?>> defaultMessageConverters() {
                return super.getMessageConverters();
            }
        }.defaultMessageConverters());
    }
    else {
        converters.addAll(new RestTemplate().getMessageConverters());
    }
    reorderXmlConvertersToEnd(converters);
    return converters;
}
项目:tracee    文件:TraceeMvcAutoConfigurationIT.java   
@SuppressWarnings("unchecked")
@Test
public void testInterceptorIsConfigured() {
    final Object configurerAdapter = context.getBean(TraceeSpringMvcConfiguration.TRACEE_WEBMVCCONFIGURERADAPTER_INTERNAL);
    assertNotNull(configurerAdapter);
    final WebMvcConfigurationSupport webmvc = context.getBean(WebMvcConfigurationSupport.class);

    final List<Object> listeners = FieldAccessUtil.getFieldVal(webmvc, "interceptors");
    Assert.assertThat(listeners, Matchers.hasItem(Matchers.instanceOf(TraceeInterceptor.class)));

}
项目:springboot-analysis    文件:TestController.java   
@RequestMapping("/test")
public String test() {
    return beanFactory.getBean(WebMvcConfigurationSupport.class).toString();
}