当前位置: 首页>>代码示例>>Java>>正文


Java WebMvcConfigurationSupport类代码示例

本文整理汇总了Java中org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport的典型用法代码示例。如果您正苦于以下问题:Java WebMvcConfigurationSupport类的具体用法?Java WebMvcConfigurationSupport怎么用?Java WebMvcConfigurationSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WebMvcConfigurationSupport类属于org.springframework.web.servlet.config.annotation包,在下文中一共展示了WebMvcConfigurationSupport类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDefaultConverters

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; //导入依赖的package包/类
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;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:HttpMessageConverters.java

示例2: initSpringRestComponent

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; //导入依赖的package包/类
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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:WebConfigurer.java

示例3: initSpringRestComponent

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; //导入依赖的package包/类
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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:WebConfigurer.java

示例4: testInterceptorIsConfigured

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; //导入依赖的package包/类
@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)));

}
 
开发者ID:tracee,项目名称:tracee,代码行数:12,代码来源:TraceeMvcAutoConfigurationIT.java

示例5: test

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; //导入依赖的package包/类
@RequestMapping("/test")
public String test() {
    return beanFactory.getBean(WebMvcConfigurationSupport.class).toString();
}
 
开发者ID:fangjian0423,项目名称:springboot-analysis,代码行数:5,代码来源:TestController.java


注:本文中的org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。