本文整理汇总了Java中org.springframework.boot.web.servlet.ServletRegistrationBean.setLoadOnStartup方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRegistrationBean.setLoadOnStartup方法的具体用法?Java ServletRegistrationBean.setLoadOnStartup怎么用?Java ServletRegistrationBean.setLoadOnStartup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.web.servlet.ServletRegistrationBean
的用法示例。
在下文中一共展示了ServletRegistrationBean.setLoadOnStartup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: camelServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
ServletRegistrationBean camelServlet() {
// use a @Bean to register the Camel servlet which we need to do
// because we want to use the camel-servlet component for the Camel REST service
ServletRegistrationBean mapping = new ServletRegistrationBean();
mapping.setName("CamelServlet");
mapping.setLoadOnStartup(1);
mapping.setServlet(new CamelHttpTransportServlet());
mapping.addUrlMappings("/camel/*");
return mapping;
}
示例2: camelServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
ServletRegistrationBean camelServlet() {
// TODO: Camel 2.19 should support this OOTB
// use a @Bean to register the Camel servlet which we need to do
// because we want to use the camel-servlet component for the Camel REST service
ServletRegistrationBean mapping = new ServletRegistrationBean();
mapping.setName("CamelServlet");
mapping.setLoadOnStartup(1);
// CamelHttpTransportServlet is the name of the Camel servlet to use
mapping.setServlet(new CamelHttpTransportServlet());
mapping.addUrlMappings("/api/*");
return mapping;
}
示例3: jerseyServletRegistration
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean jerseyServletRegistration(
JerseyProperties jerseyProperties, ResourceConfig config) {
ServletRegistrationBean registration = new ServletRegistrationBean(
new ServletContainer(config));
for (Map.Entry<String, String> entry : jerseyProperties.getInit().entrySet()) {
registration.addInitParameter(entry.getKey(), entry.getValue());
}
registration.addUrlMappings("/" +
(StringUtils.isEmpty(lyreProperties.getApplicationPath()) ? "api" : lyreProperties.getApplicationPath())
+ "/*");
registration.setName(APIx.class.getName());
registration.setLoadOnStartup(1);
return registration;
}
示例4: messageDispatcherServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean messageDispatcherServlet(
ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
String path = this.properties.getPath();
String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
ServletRegistrationBean registration = new ServletRegistrationBean(servlet,
urlMapping);
WebServicesProperties.Servlet servletProperties = this.properties.getServlet();
registration.setLoadOnStartup(servletProperties.getLoadOnStartup());
for (Map.Entry<String, String> entry : servletProperties.getInit().entrySet()) {
registration.addInitParameter(entry.getKey(), entry.getValue());
}
return registration;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:WebServicesAutoConfiguration.java
示例5: 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
示例6: 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;
}
示例7: servletRegistrationBean
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
ServletRegistrationBean registration = new ServletRegistrationBean(
new HystrixMetricsStreamServlet(), "/hystrix.stream");
registration.setName("hystrixServlet");
registration.setLoadOnStartup(1);
return registration;
}
示例8: oauth
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean oauth() {
DispatcherServlet dispatcherServlet = new DispatcherServlet();
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(dispatcherServlet,
"/oauth/token");
servletRegistrationBean.setName("oauth");
servletRegistrationBean.setLoadOnStartup(1);
return servletRegistrationBean;
}
示例9: springBatchSupportServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean springBatchSupportServlet() {
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(SpringBatchSupportWebServletConfig.class);
DispatcherServlet dispatcherServlet = new DispatcherServlet();
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet, getServletMapping());
registrationBean.setName(getServletName());
registrationBean.setLoadOnStartup(1);
return registrationBean;
}
示例10: configurationServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean configurationServlet() {
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(ConfigServletConfig.class);
DispatcherServlet dispatcherServlet = new DispatcherServlet();
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet, namicsConfigurationProperties.getWeb()
.getServletMapping());
registrationBean.setName(namicsConfigurationProperties.getWeb().getServletName());
registrationBean.setLoadOnStartup(1);
return registrationBean;
}
开发者ID:namics,项目名称:spring-configuration-support,代码行数:16,代码来源:SpringConfigurationSupportWebAutoConfiguration.java
示例11: i18nSupportServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean i18nSupportServlet() {
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(I18nWebConfig.class);
DispatcherServlet dispatcherServlet = new DispatcherServlet();
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet, getServletMapping());
registrationBean.setName(getServletName());
registrationBean.setLoadOnStartup(1);
return registrationBean;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
示例15: richfacesResourcesServlet
import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean richfacesResourcesServlet() {
ServletRegistrationBean result = new ServletRegistrationBean();
result.setServlet(new ResourceServlet());
result.setLoadOnStartup(1);
result.addUrlMappings("/org.richfaces.resources/*");
return result;
}