當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。