本文整理匯總了Java中org.springframework.boot.context.embedded.ServletRegistrationBean.setLoadOnStartup方法的典型用法代碼示例。如果您正苦於以下問題:Java ServletRegistrationBean.setLoadOnStartup方法的具體用法?Java ServletRegistrationBean.setLoadOnStartup怎麽用?Java ServletRegistrationBean.setLoadOnStartup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.boot.context.embedded.ServletRegistrationBean
的用法示例。
在下文中一共展示了ServletRegistrationBean.setLoadOnStartup方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean(name = "configServlet")
public ServletRegistrationBean configServlet() {
DispatcherServlet dispatcherServlet = new DispatcherServlet();
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(ConfigServletConfig.class);
dispatcherServlet.setApplicationContext(applicationContext);
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet, "/config/*");
registrationBean.setLoadOnStartup(1);
return registrationBean;
}
示例2: facesServletRegistraiton
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistraiton() {
ServletRegistrationBean registration = new ServletRegistrationBean(new javax.faces.webapp.FacesServlet(),
"*.xhtml");
registration.setName("Faces Servlet");
registration.setLoadOnStartup(1);
return registration;
}
示例3: facesServletRegistraiton
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistraiton() {
ServletRegistrationBean registration = new ServletRegistrationBean(new FacesServlet(), "*.xhtml");
registration.setName("Faces Servlet");
registration.setLoadOnStartup(1);
return registration;
}
示例4: facesServletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
new FacesServlet(), "*.xhtml");
registration.setLoadOnStartup(1);
return registration;
}
示例5: facesServletRegistration
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean facesServletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(
new FacesServlet(), "*.xhtml");
registration.setLoadOnStartup(1);
return registration;
}
示例6: servletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
@Autowired
public ServletRegistrationBean servletRegistrationBean(MetricRegistry metricRegistry) {
MetricsServlet ms = new MetricsServlet(metricRegistry);
ServletRegistrationBean srb = new ServletRegistrationBean(ms, "/stats/*");
srb.setLoadOnStartup(1);
return srb;
}
示例7: servletHealthRegistryBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
@Autowired
public ServletRegistrationBean servletHealthRegistryBean(HealthCheckRegistry healthCheckRegistry) {
HealthCheckServlet hc = new HealthCheckServlet(healthCheckRegistry);
ServletRegistrationBean srb = new ServletRegistrationBean(hc, "/health/*");
srb.setLoadOnStartup(2);
return srb;
}
示例8: memoryMonitorStartupServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean memoryMonitorStartupServlet() {
ServletRegistrationBean registration =
new ServletRegistrationBean(new MemoryMonitorStartupServlet(), "/admin4j/memory");
registration.setLoadOnStartup(1);
return registration;
}
示例9: atmosphereServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean atmosphereServlet() {
// Dispatcher servlet is mapped to '/home' to allow the AtmosphereServlet
// to be mapped to '/chat'
ServletRegistrationBean registration = new ServletRegistrationBean(
new AtmosphereServlet(), "/chat/*");
registration.addInitParameter("org.atmosphere.cpr.packages", "sample");
registration.addInitParameter("org.atmosphere.interceptor.HeartbeatInterceptor"
+ ".clientHeartbeatFrequencyInSeconds", "10");
registration.setLoadOnStartup(0);
// Need to occur before the EmbeddedAtmosphereInitializer
registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
return registration;
}
示例10: servletRegistrationLessBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean servletRegistrationLessBean(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean(new LessServlet(), "*.less");
registrationBean.setLoadOnStartup(1);
registrationBean.setName("LessServlet");
registrationBean.addInitParameter("cache", lessCached);
return registrationBean;
}
示例11: servletRegistrationCoffeeBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean servletRegistrationCoffeeBean(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean(new CoffeeServlet(), "*.coffee");
registrationBean.setLoadOnStartup(1);
registrationBean.setName("CoffeeScript");
registrationBean.addInitParameter("cache",coffeeCached);
return registrationBean;
}
示例12: cxfServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean cxfServlet() {
LOGGER.info("Initializing CXF");
ServletRegistrationBean servletDef = new ServletRegistrationBean(new CXFServlet(), "/api/soap/*");
servletDef.setLoadOnStartup(1);
return servletDef;
}
示例13: soapServletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean soapServletRegistrationBean() {
log.info("+++ soapServletRegistration");
ServletRegistrationBean registration = new ServletRegistrationBean(new CXFServlet(), "/services/*");
registration.setLoadOnStartup(1);
registration.setName("CXFServlet");
return registration;
}
示例14: webflowServlet
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean webflowServlet() {
ServletRegistrationBean registration = new ServletRegistrationBean();
registration.setServlet(new DispatcherServlet(new AnnotationConfigWebApplicationContext()));
registration.addUrlMappings("/spring/*");
registration.setLoadOnStartup(1);
registration.setName("webflowServlet");
return registration;
}
示例15: repositoryServletRegistrationBean
import org.springframework.boot.context.embedded.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean repositoryServletRegistrationBean(
RepositoryHttpServlet repositoryHttpServlet) {
ServletRegistrationBean servletRegistrationBean =
new ServletRegistrationBean(repositoryHttpServlet, "/repository_servlet/*");
servletRegistrationBean.setLoadOnStartup(1);
return servletRegistrationBean;
}