当前位置: 首页>>代码示例>>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;未经允许,请勿转载。