Search in sources :

Example 1 with ServletRegistrationBean

use of org.springframework.boot.context.embedded.ServletRegistrationBean in project kylo by Teradata.

the class SpringJerseyConfiguration method jerseyServlet.

@Bean(name = "mainJerseyServlet")
public ServletRegistrationBean jerseyServlet(JerseyConfig jerseyConfig) {
    ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(jerseyConfig));
    registration.addUrlMappings("/api/*");
    // our rest resources will be available in the path /api/*
    registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
    return registration;
}
Also used : ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) ServletContainer(org.glassfish.jersey.servlet.ServletContainer) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ServletRegistrationBean

use of org.springframework.boot.context.embedded.ServletRegistrationBean in project pokebattler-fight by celandro.

the class BlogProxyConfiguration method servletRegistrationBean.

@Bean
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new CachingProxyServlet(), propertyResolver.getProperty("servlet_url"));
    servletRegistrationBean.addInitParameter("targetUri", propertyResolver.getProperty("target_url"));
    servletRegistrationBean.addInitParameter(CachingProxyServlet.P_CACHE_CONTROL, propertyResolver.getProperty("cache_control"));
    servletRegistrationBean.addInitParameter(ProxyServlet.P_LOG, propertyResolver.getProperty("logging_enabled", "false"));
    return servletRegistrationBean;
}
Also used : ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with ServletRegistrationBean

use of org.springframework.boot.context.embedded.ServletRegistrationBean in project JavaExercises by biblelamp.

the class JsfConfig method facesServletRegistration.

@Bean
public ServletRegistrationBean facesServletRegistration() {
    ServletRegistrationBean servletRegistrationBean = new JsfServletRegistrationBean(new MyFacesServlet());
    servletRegistrationBean.setLoadOnStartup(1);
    return servletRegistrationBean;
}
Also used : MyFacesServlet(org.apache.myfaces.webapp.MyFacesServlet) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with ServletRegistrationBean

use of org.springframework.boot.context.embedded.ServletRegistrationBean in project x-pipe by ctripcorp.

the class SSOConfigurations method logoutServlet.

@Bean
public ServletRegistrationBean logoutServlet() {
    ServletRegistrationBean logoutServlet = new ServletRegistrationBean();
    logoutServlet.setServlet(servlet("com.ctrip.infosec.sso.client.logout.Logout"));
    logoutServlet.addUrlMappings("/logout");
    return logoutServlet;
}
Also used : ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 5 with ServletRegistrationBean

use of org.springframework.boot.context.embedded.ServletRegistrationBean in project vaadin-samples by xpoft.

the class Application method servletRegistrationBean.

@Bean
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new SpringVaadinServlet());
    // Servlet. init-param
    Map<String, String> params = new HashMap<String, String>();
    params.put("beanName", "myUI");
    registration.setInitParameters(params);
    return registration;
}
Also used : HashMap(java.util.HashMap) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) SpringVaadinServlet(ru.xpoft.vaadin.SpringVaadinServlet) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ServletRegistrationBean (org.springframework.boot.context.embedded.ServletRegistrationBean)8 Bean (org.springframework.context.annotation.Bean)8 ServletContainer (org.glassfish.jersey.servlet.ServletContainer)2 FilterRegistrationBean (org.springframework.boot.context.embedded.FilterRegistrationBean)2 HashMap (java.util.HashMap)1 MyFacesServlet (org.apache.myfaces.webapp.MyFacesServlet)1 SimonConsoleServlet (org.javasimon.console.SimonConsoleServlet)1 SpringVaadinServlet (ru.xpoft.vaadin.SpringVaadinServlet)1