當前位置: 首頁>>代碼示例>>Java>>正文


Java ServletRegistrationBean.setName方法代碼示例

本文整理匯總了Java中org.springframework.boot.web.servlet.ServletRegistrationBean.setName方法的典型用法代碼示例。如果您正苦於以下問題:Java ServletRegistrationBean.setName方法的具體用法?Java ServletRegistrationBean.setName怎麽用?Java ServletRegistrationBean.setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.web.servlet.ServletRegistrationBean的用法示例。


在下文中一共展示了ServletRegistrationBean.setName方法的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;
}
 
開發者ID:funktionio,項目名稱:funktion-connectors,代碼行數:12,代碼來源:FunktionRouteBuilder.java

示例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;
}
 
開發者ID:abouchama,項目名稱:camel-springboot-rest-ose,代碼行數:14,代碼來源:route.java

示例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;

}
 
開發者ID:groovylabs,項目名稱:lyre,代碼行數:20,代碼來源:Lyre.java

示例4: registerProxyServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
/**
 * Configures a custom jetty http proxy servlet based on <b>oneops.proxy.enabled</b>
 * config property. The proxy configuration is done on the <b>application.yaml</b> file.
 *
 * @param config OneOps config
 * @return {@link ServletRegistrationBean}
 */
@Bean
@ConditionalOnProperty("oneops.proxy.enabled")
public ServletRegistrationBean registerProxyServlet(OneOpsConfig config) {
    log.info("OneOps Http Proxy is enabled.");
    OneOpsConfig.Proxy proxyCfg = config.getProxy();

    Map<String, String> initParams = new HashMap<>();
    initParams.put(proxyTo.name(), proxyCfg.getProxyTo());
    initParams.put(prefix.name(), proxyCfg.getPrefix());
    initParams.put(viaHost.name(), proxyCfg.getViaHost());
    initParams.put(trustAll.name(), String.valueOf(proxyCfg.isTrustAll()));
    initParams.put(xAuthHeader.name(), config.getAuth().getHeader());

    ServletRegistrationBean servletBean = new ServletRegistrationBean(new ProxyServlet(), proxyCfg.getPrefix() + "/*");
    servletBean.setName("OneOps Proxy Servlet");
    servletBean.setInitParameters(initParams);
    servletBean.setAsyncSupported(true);
    log.info("Configured OneOps proxy servlet with mapping: " + proxyCfg.getPrefix());
    return servletBean;
}
 
開發者ID:oneops,項目名稱:secrets-proxy,代碼行數:28,代碼來源:EmbeddedServerConfig.java

示例5: sessionServletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
protected final ServletContextInitializer sessionServletRegistration() {
	ServletRegistrationBean bean = new ServletRegistrationBean(new ExampleServlet() {

		@Override
		public void service(ServletRequest request, ServletResponse response)
				throws ServletException, IOException {
			HttpSession session = ((HttpServletRequest) request).getSession(true);
			long value = System.currentTimeMillis();
			Object existing = session.getAttribute("boot");
			session.setAttribute("boot", value);
			PrintWriter writer = response.getWriter();
			writer.append(String.valueOf(existing) + ":" + value);
		}

	}, "/session");
	bean.setName("session");
	return bean;
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:19,代碼來源:AbstractEmbeddedServletContainerFactoryTests.java

示例6: 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;
}
 
開發者ID:rsdomingues,項目名稱:netflixmicroservices-tdc2017,代碼行數:9,代碼來源:HystrixConfig.java

示例7: cxfServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean cxfServlet() {
    final ServletRegistrationBean bean = new ServletRegistrationBean();
    bean.setEnabled(true);
    bean.setName("cxfServletSecurityTokenService");
    bean.setServlet(new CXFServlet());
    bean.setUrlMappings(Collections.singleton(WSFederationConstants.ENDPOINT_STS.concat("*")));
    bean.setAsyncSupported(true);
    return bean;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:11,代碼來源:CoreWsSecuritySecurityTokenServiceConfiguration.java

示例8: apiServletBean

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean apiServletBean(WebApplicationContext webApplicationContext) {
    DispatcherServlet servlet = new DispatcherServlet(webApplicationContext);
    ServletRegistrationBean bean = new ServletRegistrationBean(servlet, "/api/*");
    bean.setName("ApiServlet");
    return bean;
}
 
開發者ID:stephenml,項目名稱:basic,代碼行數:8,代碼來源:Application.java

示例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;
}
 
開發者ID:namics,項目名稱:spring-batch-support,代碼行數:15,代碼來源:SpringBatchSupportWebAutoConfiguration.java

示例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: alexaServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
/**
 * Registers the {@link SpeechletServlet} at the application.
 *
 * @param speechlet Speechlet.
 * @return Registration.
 */
@Bean
public ServletRegistrationBean alexaServlet(WarehouseSpeechlet speechlet) {
    SpeechletServlet speechServlet = new SpeechletServlet();
    speechServlet.setSpeechlet(speechlet);

    ServletRegistrationBean servlet = new ServletRegistrationBean(speechServlet, "/alexa");
    servlet.setName("alexa");

    return servlet;
}
 
開發者ID:qaware,項目名稱:iot-hessen-amazon-echo,代碼行數:17,代碼來源:WarehouseApplication.java

示例12: 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;
}
 
開發者ID:namics,項目名稱:spring-i18n-support,代碼行數:14,代碼來源:SpringI18nSupportWebAutoConfiguration.java

示例13: dispatcherServletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //導入方法依賴的package包/類
@Bean
public ServletRegistrationBean dispatcherServletRegistration() {
    final ServletRegistrationBean registration = new ServletRegistrationBean(
            dispatcherServlet(),
            "/" + this.pathPrefix + "/*"
    );
    registration.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
    return registration;
}
 
開發者ID:anthonyraymond,項目名稱:joal,代碼行數:10,代碼來源:EndpointObfuscatorConfiguration.java

示例14: 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;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:11,代碼來源:AppMVCConfiguration.java

示例15: 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;
}
 
開發者ID:react-dev26,項目名稱:NGB-master,代碼行數:11,代碼來源:AppMVCConfiguration.java


注:本文中的org.springframework.boot.web.servlet.ServletRegistrationBean.setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。