本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}