Search in sources :

Example 1 with RestServlet

use of io.servicecomb.transport.rest.servlet.RestServlet in project java-chassis by ServiceComb.

the class CseEmbeddedServlet method restServletRegistration.

@Bean
public ServletRegistrationBean restServletRegistration() {
    String name = env.getProperty("cse.servlet.name");
    name = name == null ? DEFAULT_SERVLET_NAME : name;
    String url = env.getProperty("cse.servlet.url");
    url = url == null ? DEFAULT_URL : url;
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(new RestServlet(), url);
    registrationBean.setName(name);
    return registrationBean;
}
Also used : ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) RestServlet(io.servicecomb.transport.rest.servlet.RestServlet) ServletRegistrationBean(org.springframework.boot.web.servlet.ServletRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

RestServlet (io.servicecomb.transport.rest.servlet.RestServlet)1 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1