Example usage for org.springframework.web.servlet DispatcherServlet DispatcherServlet

List of usage examples for org.springframework.web.servlet DispatcherServlet DispatcherServlet

Introduction

In this page you can find the example usage for org.springframework.web.servlet DispatcherServlet DispatcherServlet.

Prototype

public DispatcherServlet(WebApplicationContext webApplicationContext) 

Source Link

Document

Create a new DispatcherServlet with the given web application context.

Usage

From source file:org.springframework.xd.dirt.stream.StreamServer.java

@Override
public void afterPropertiesSet() {
    this.scheduler.setPoolSize(3);
    this.scheduler.initialize();
    this.tomcat.setPort(this.port);
    Context tomcatContext = this.tomcat.addContext(this.contextPath, new File(".").getAbsolutePath());
    this.webApplicationContext.setServletContext(tomcatContext.getServletContext());
    this.webApplicationContext.refresh();
    Tomcat.addServlet(tomcatContext, this.servletName, new DispatcherServlet(this.webApplicationContext));
    tomcatContext.addServletMapping("/", this.servletName);
    if (logger.isInfoEnabled()) {
        logger.info("initialized server: context=" + this.contextPath + ", servlet=" + this.servletName);
    }/*from   ww w .j av a 2s. c om*/
}