當前位置: 首頁>>代碼示例>>Java>>正文


Java ServletRegistrationBean.setAsyncSupported方法代碼示例

本文整理匯總了Java中org.springframework.boot.web.servlet.ServletRegistrationBean.setAsyncSupported方法的典型用法代碼示例。如果您正苦於以下問題:Java ServletRegistrationBean.setAsyncSupported方法的具體用法?Java ServletRegistrationBean.setAsyncSupported怎麽用?Java ServletRegistrationBean.setAsyncSupported使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.web.servlet.ServletRegistrationBean的用法示例。


在下文中一共展示了ServletRegistrationBean.setAsyncSupported方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerProxyServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
/**
 * Configures a custom jetty http proxy servlet based on <b>oneops.proxy.enabled</b>
 * config property. The proxy configuration is done on the <b>application.yaml</b> file.
 *
 * @param config OneOps config
 * @return {@link ServletRegistrationBean}
 */
@Bean
@ConditionalOnProperty("oneops.proxy.enabled")
public ServletRegistrationBean registerProxyServlet(OneOpsConfig config) {
    log.info("OneOps Http Proxy is enabled.");
    OneOpsConfig.Proxy proxyCfg = config.getProxy();

    Map<String, String> initParams = new HashMap<>();
    initParams.put(proxyTo.name(), proxyCfg.getProxyTo());
    initParams.put(prefix.name(), proxyCfg.getPrefix());
    initParams.put(viaHost.name(), proxyCfg.getViaHost());
    initParams.put(trustAll.name(), String.valueOf(proxyCfg.isTrustAll()));
    initParams.put(xAuthHeader.name(), config.getAuth().getHeader());

    ServletRegistrationBean servletBean = new ServletRegistrationBean(new ProxyServlet(), proxyCfg.getPrefix() + "/*");
    servletBean.setName("OneOps Proxy Servlet");
    servletBean.setInitParameters(initParams);
    servletBean.setAsyncSupported(true);
    log.info("Configured OneOps proxy servlet with mapping: " + proxyCfg.getPrefix());
    return servletBean;
}
 
開發者ID:oneops,項目名稱:secrets-proxy,代碼行數:28,代碼來源:EmbeddedServerConfig.java

示例2: keycloakJaxRsApplication

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
ServletRegistrationBean keycloakJaxRsApplication(KeycloakServerProperties keycloakServerProperties, DataSource dataSource) throws Exception {

  mockJndiEnvironment(dataSource);

  //FIXME: hack to propagate Spring Boot Properties to Keycloak Application
  EmbeddedKeycloakApplication.keycloakServerProperties = keycloakServerProperties;

  ServletRegistrationBean servlet = new ServletRegistrationBean(new HttpServlet30Dispatcher());
  servlet.addInitParameter("javax.ws.rs.Application", EmbeddedKeycloakApplication.class.getName());
  servlet.addInitParameter(ResteasyContextParameters.RESTEASY_SERVLET_MAPPING_PREFIX, keycloakServerProperties.getContextPath());
  servlet.addInitParameter(ResteasyContextParameters.RESTEASY_USE_CONTAINER_FORM_PARAMS, "true");
  servlet.addUrlMappings(keycloakServerProperties.getContextPath() + "/*");
  servlet.setLoadOnStartup(1);
  servlet.setAsyncSupported(true);

  return servlet;
}
 
開發者ID:thomasdarimont,項目名稱:spring-boot-keycloak-server-example,代碼行數:19,代碼來源:EmbeddedKeycloakConfig.java

示例3: routeServlet1

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
public ServletRegistrationBean routeServlet1(RouterFunction<?> routerFunction) throws Exception {
HttpHandler httpHandler = RouterFunctions.toHttpHandler(routerFunction );
ServletHttpHandlerAdapter servlet = new ServletHttpHandlerAdapter(httpHandler);

     ServletRegistrationBean registrationBean = new ServletRegistrationBean<>(servlet, "/flux" + "/*");
     registrationBean.setLoadOnStartup(1);
     registrationBean.setAsyncSupported(true);
     
 	System.out.println("starts server");		
     return registrationBean;
 }
 
開發者ID:PacktPublishing,項目名稱:Spring-5.0-Cookbook,代碼行數:12,代碼來源:HttpServerConfig.java

示例4: cxfServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean cxfServlet() {
    final ServletRegistrationBean bean = new ServletRegistrationBean();
    bean.setEnabled(true);
    bean.setName("cxfServletSecurityTokenService");
    bean.setServlet(new CXFServlet());
    bean.setUrlMappings(Collections.singleton(WSFederationConstants.ENDPOINT_STS.concat("*")));
    bean.setAsyncSupported(true);
    return bean;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:11,代碼來源:CoreWsSecuritySecurityTokenServiceConfiguration.java

示例5: servletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
ServletRegistrationBean servletRegistration(DruidStatProperties druidStatConfig) {
	ServletRegistrationBean filterRegistration = new ServletRegistrationBean(new StatViewServlet());
	filterRegistration.setAsyncSupported(true);
	filterRegistration.setEnabled(true);
	filterRegistration.addUrlMappings("/druid/*");
	filterRegistration.setInitParameters(druidStatParameters(druidStatConfig));
	return filterRegistration;
}
 
開發者ID:halober,項目名稱:spring-boot-starter-dao,代碼行數:10,代碼來源:DruidWebStatAutoConfiguration.java

示例6: dispatcherRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean dispatcherRegistration(DispatcherServlet dispatcherServlet){
    ServletRegistrationBean bean =
            new ServletRegistrationBean(dispatcherServlet, "/restapi/*");
    bean.setAsyncSupported(true);
    bean.setName("catgenome");
    bean.setLoadOnStartup(1);

    return bean;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:11,代碼來源:AppMVCConfiguration.java

示例7: servletRegistrationBean

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean // for socket.io
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean bean = new ServletRegistrationBean(new AtmosphereServlet(), "/coding-ide-tty1/*");

    bean.addInitParameter("socketio-transport", "websocket");
    bean.addInitParameter("socketio-timeout", "25000");
    bean.addInitParameter("socketio-heartbeat", "15000");
    bean.addInitParameter("socketio-suspendTime", "30000");
    bean.addInitParameter("org.atmosphere.cpr.sessionSupport", "true");
    bean.addInitParameter("SPACE_HOME", spaceHome);
    bean.setLoadOnStartup(100);
    bean.setAsyncSupported(true);

    return bean;
}
 
開發者ID:Coding,項目名稱:WebIDE-Backend,代碼行數:16,代碼來源:WebSocketConfig.java

示例8: dispatcherServletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
/**
 * Register dispatcherServlet programmatically
 *
 * @return ServletRegistrationBean
 */
@Bean
public ServletRegistrationBean dispatcherServletRegistration() {

	ServletRegistrationBean registration = new ServletRegistrationBean(
		dispatcherServlet(), "/");

	registration
		.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
	registration.setAsyncSupported(true);
	registration.setEnabled(true);
	registration.setLoadOnStartup(1);

	return registration;
}
 
開發者ID:AppDirect,項目名稱:service-integration-sdk,代碼行數:20,代碼來源:AsyncServletConfiguration.java


注:本文中的org.springframework.boot.web.servlet.ServletRegistrationBean.setAsyncSupported方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。