org.springframework.boot.context.embedded.ServletRegistrationBean Java Examples

The following examples show how to use org.springframework.boot.context.embedded.ServletRegistrationBean. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CxfServletRegister.java    From lemonaid with MIT License 5 votes vote down vote up
@Bean
public ServletRegistrationBean getODataServletRegistrationBean() {
	ServletRegistrationBean odataServletRegistrationBean = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/odata.svc/*");
	Map<String, String> initParameters = new HashMap<String, String>();
	initParameters.put("javax.ws.rs.Application", "org.apache.olingo.odata2.core.rest.app.ODataApplication");
	initParameters.put("org.apache.olingo.odata2.service.factory", "com.sap.mentors.lemonaid.odata.JPAServiceFactory");
	odataServletRegistrationBean.setInitParameters(initParameters);
	return odataServletRegistrationBean;
}
 
Example #2
Source File: DiscoveryServerMain.java    From Ratel with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean jerseyServlet() throws ServletException {
    ServletContainer servlet = new ServletContainer();
    ServletRegistrationBean registration = new ServletRegistrationBean(servlet, "/server/*");
    registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
    return registration;
}
 
Example #3
Source File: WebServiceConfig.java    From spring-boot-samples with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean 
			dispatcherServlet(ApplicationContext applicationContext){
	MessageDispatcherServlet servlet = new MessageDispatcherServlet();
	servlet.setApplicationContext(applicationContext);
	servlet.setTransformWsdlLocations(true);
	return new ServletRegistrationBean(servlet, "/services/*");
}
 
Example #4
Source File: MonetaSpringBootApplication.java    From moneta with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean monetaTopicListServlet() {
	ServletRegistrationBean registration =
			new ServletRegistrationBean(new MonetaTopicListServlet(),
					"/moneta/topics/*");
	return registration;
}
 
Example #5
Source File: MonetaSpringBootApplication.java    From moneta with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean monetaServlet() {
	ServletRegistrationBean registration =
			new ServletRegistrationBean(new MonetaServlet(),
					"/moneta/topic/*");
	registration.addInitParameter(
			MonetaServlet.CONFIG_IGNORED_CONTEXT_PATH_NODES, "moneta,topic");
	return registration;
}
 
Example #6
Source File: MonetaSpringBootApplication.java    From moneta with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean memoryMonitorStartupServlet() {
	ServletRegistrationBean registration =
			new ServletRegistrationBean(new MemoryMonitorStartupServlet(), "/admin4j/memory");
	registration.setLoadOnStartup(1);
	return registration;
}
 
Example #7
Source File: CxfServletRegister.java    From odata-boilerplate with MIT License 5 votes vote down vote up
@Bean
public ServletRegistrationBean getODataServletRegistrationBean() {
	ServletRegistrationBean odataServletRegistrationBean = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/odata.svc/*");
	Map<String, String> initParameters = new HashMap<String, String>();
	initParameters.put("javax.ws.rs.Application", "org.apache.olingo.odata2.core.rest.app.ODataApplication");
	initParameters.put("org.apache.olingo.odata2.service.factory", "com.penninkhof.odata.utils.JPAServiceFactory");
	odataServletRegistrationBean.setInitParameters(initParameters);
	return odataServletRegistrationBean;
}
 
Example #8
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #9
Source File: ApplicationInitializer.java    From boot-makeover with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean jerseyServlet() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/v1.0/**");
    registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
    return registration;
}
 
Example #10
Source File: Application.java    From boot-examples with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean jerseyServlet() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/*");
    registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JaxRsApplication.class.getName());
    return registration;
}
 
Example #11
Source File: DandelionConfig.java    From enhanced-pet-clinic with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean dandelionServletRegistrationBean() {
	return new ServletRegistrationBean(new DandelionServlet(), "/dandelion-assets/*");
}
 
Example #12
Source File: TestApplication.java    From spring-boot-starter-netty with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean nullServletRegistration() {
    return new ServletRegistrationBean(new NullHttpServlet(), "/null");
}
 
Example #13
Source File: Application.java    From onboard with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean servletRegistrationBean() throws ServletException {
    return new ServletRegistrationBean(getGitServlet(), "/api/*");
}
 
Example #14
Source File: Application.java    From spring-cxf with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean servletRegistrationBean(ApplicationContext context) {
    return new ServletRegistrationBean(new CXFServlet(), "/api/*");
}
 
Example #15
Source File: HystrixDashboardApplication.java    From spring-cloud-microservice-example with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean mockStreamServlet() {
    return new ServletRegistrationBean(new MockStreamServlet(), "/mock.stream");
}
 
Example #16
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #17
Source File: RoothubApplication.java    From Roothub with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * 注册 H2 数据库访问 Servlet
 * @return
 */
@Bean
   public ServletRegistrationBean createH2WebServlet(){
       ServletRegistrationBean servlet = new ServletRegistrationBean(new WebServlet(),"/h2-console/*");
       return servlet;
   }
 
Example #18
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), "/soap-api/*");
}
 
Example #19
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #20
Source File: SimpleBootCxfApplication.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), "/soap-api/*");
}
 
Example #21
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #22
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #23
Source File: SimpleBootCxfApplication.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), "/soap-api/*");
}
 
Example #24
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), "/soap-api/*");
}
 
Example #25
Source File: WebServiceConfiguration.java    From tutorial-soap-spring-boot-cxf with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean cxfServlet() {
    return new ServletRegistrationBean(new CXFServlet(), BASE_URL + "/*");
}
 
Example #26
Source File: DbAuthConfig.java    From video-streaming-service with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean h2servletRegistration() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
    registration.addUrlMappings("/console/*");
    return registration;
}
 
Example #27
Source File: HystrixServletConfiguration.java    From ola with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean jerseyServlet() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new HystrixMetricsStreamServlet(), "/hystrix.stream");
    return registration;
}
 
Example #28
Source File: JsfConfig.java    From JavaExercises with GNU General Public License v2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean facesServletRegistration() {
    ServletRegistrationBean servletRegistrationBean = new JsfServletRegistrationBean(new MyFacesServlet());
    servletRegistrationBean.setLoadOnStartup(1);
    return servletRegistrationBean;
}
 
Example #29
Source File: DataConfig.java    From springboot_cwenao with MIT License 4 votes vote down vote up
@Bean
public ServletRegistrationBean druidServlet() {
    return new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
}