本文整理汇总了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;
}