當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。