当前位置: 首页>>代码示例>>Java>>正文


Java ServletRegistrationBean类代码示例

本文整理汇总了Java中org.springframework.boot.context.embedded.ServletRegistrationBean的典型用法代码示例。如果您正苦于以下问题:Java ServletRegistrationBean类的具体用法?Java ServletRegistrationBean怎么用?Java ServletRegistrationBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServletRegistrationBean类属于org.springframework.boot.context.embedded包,在下文中一共展示了ServletRegistrationBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getODataServletRegistrationBean

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@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;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:10,代码来源:CxfServletRegister.java

示例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;
}
 
开发者ID:Arquisoft,项目名称:Voting_2b,代码行数:12,代码来源:Main.java

示例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;
}
 
开发者ID:Arquisoft,项目名称:Voting_2b,代码行数:8,代码来源:Application.java

示例4: getODataServletRegistrationBean

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@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;
}
 
开发者ID:jpenninkhof,项目名称:odata-boilerplate,代码行数:10,代码来源:CxfServletRegister.java

示例5: dispatcherServletRegistration

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean(name = DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME)
public ServletRegistrationBean dispatcherServletRegistration() {
	ServletRegistrationBean registration = new ServletRegistrationBean(
			dispatcherServlet(), this.server.getServletMapping());
	registration.setName(DEFAULT_DISPATCHER_SERVLET_BEAN_NAME);
	if (this.multipartConfig != null) {
		registration.setMultipartConfig(this.multipartConfig);
	}
	return registration;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:DispatcherServletAutoConfiguration.java

示例6: servletRegistrationBean

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean(name="springBootServletRegistrationBean")
 public ServletRegistrationBean servletRegistrationBean() {
     SpringVaadinServlet servlet = new SpringVaadinServlet() {

         private static final long serialVersionUID = 1L;

@Override
         public void servletInitialized() throws ServletException {
             super.servletInitialized();
             getService().addSessionInitListener(new TraderSessionInitListener());
         }
         
     };
     
     return new ServletRegistrationBean(servlet, "/ui/*", "/VAADIN/*");
 }
 
开发者ID:xyfreemind,项目名称:trader,代码行数:17,代码来源:TraderUI.java

示例7: 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;
}
 
开发者ID:namics,项目名称:spring-configuration-support,代码行数:11,代码来源:SampleApplication.java

示例8: registerServlet

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean
public ServletRegistrationBean registerServlet(){
	ServletRegistrationBean statViewServletRegistrationBean = 
			new ServletRegistrationBean(dispatchDruidServlet(), "/druid/*");
	/* 
	 * According to the definition of StatViewServlet, the white-list of druid StatViewServlet
	 * can be specifed with the format as "xxx.xxx.xxx.xxx/yyy.yyy.yyy.yyy" to limit the access to 
	 * the StatViewServlet.  
	 */
	statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_ALLOW,  "127.0.0.1");
	statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_USERNAME, "admin");
	statViewServletRegistrationBean.addInitParameter(StatViewServlet.PARAM_NAME_PASSWORD, "password");
	return statViewServletRegistrationBean;
}
 
开发者ID:xiaowing,项目名称:various_demos,代码行数:15,代码来源:ServletConfig.java

示例9: messageDispatcherServlet

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
	MessageDispatcherServlet servlet = new MessageDispatcherServlet();
	servlet.setApplicationContext(applicationContext);
	servlet.setTransformWsdlLocations(true);
	return new ServletRegistrationBean(servlet, "/ws/*");
}
 
开发者ID:vrk-kpa,项目名称:xroad-catalog,代码行数:8,代码来源:WebServiceConfig.java

示例10: messageDispatcherServlet

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
    log.info("Registering message dispatcher servlet.");
    MessageDispatcherServlet servlet = new MessageDispatcherServlet();
    servlet.setApplicationContext(applicationContext);
    servlet.setTransformWsdlLocations(true);
    return new ServletRegistrationBean(servlet, "/soap-api/*");
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:9,代码来源:WebServiceConfiguration.java

示例11: statViewServlet

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean
@Order
public ServletRegistrationBean statViewServlet() {
	StatViewServlet servlet = new StatViewServlet();
	ServletRegistrationBean bean = new ServletRegistrationBean(servlet, "/druid/*");
	return bean;
}
 
开发者ID:mazhaoyong,项目名称:api-server-seed,代码行数:8,代码来源:WebConfig.java

示例12: 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;
}
 
开发者ID:Arquisoft,项目名称:VotingSystem_1b,代码行数:8,代码来源:Main.java

示例13: doHandle

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Override
public void doHandle(Map<String, Object> attributes, BeanDefinition beanDefinition,
        BeanDefinitionRegistry registry) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ServletRegistrationBean.class);
    builder.addPropertyValue("asyncSupported", attributes.get("asyncSupported"));
    builder.addPropertyValue("initParameters", extractInitParameters(attributes));
    builder.addPropertyValue("loadOnStartup", attributes.get("loadOnStartup"));
    String name = determineName(attributes, beanDefinition);
    builder.addPropertyValue("name", name);
    builder.addPropertyValue("servlet", beanDefinition);
    builder.addPropertyValue("urlMappings", extractUrlPatterns("urlPatterns", attributes));
    registry.registerBeanDefinition(name, builder.getBeanDefinition());
}
 
开发者ID:PebbleTemplates,项目名称:pebble-spring-boot-starter,代码行数:14,代码来源:WebServletHandler.java

示例14: h2servletRegistration

import org.springframework.boot.context.embedded.ServletRegistrationBean; //导入依赖的package包/类
@Bean
ServletRegistrationBean h2servletRegistration()
{
    ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
    registrationBean.addUrlMappings("/console/*");
    return registrationBean;
}
 
开发者ID:Arquisoft,项目名称:Voting_2b,代码行数:8,代码来源:WebConfiguration.java

示例15: 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;
}
 
开发者ID:Arquisoft,项目名称:Voting_2b,代码行数:8,代码来源:Application.java


注:本文中的org.springframework.boot.context.embedded.ServletRegistrationBean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。