spring-guides / getting-started-guides

Getting Started Guide template :: The template for new guides and also the place to request them.
https://github.com/spring-guides/getting-started-guides/wiki
Apache License 2.0
521 stars 204 forks source link

The method setApplicationContext(ApplicationContext) is undefined for the type MessageDispatcherServlet #37

Closed tusharbanne closed 7 years ago

tusharbanne commented 7 years ago
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
        MessageDispatcherServlet servlet = new MessageDispatcherServlet();
        servlet.setApplicationContext(applicationContext);
        servlet.setTransformWsdlLocations(true);
        return new ServletRegistrationBean(servlet, "/ws/*");
    }

In the above method, servlet.setApplicationContext(applicationContext);

gives an error

The method setApplicationContext(ApplicationContext) is undefined for the type MessageDispatcherServlet

when checked the API of MessageDispatcherServlet, there isn't any method setApplicationContext.

Please Help.

dsyer commented 7 years ago

Which guide did you see this in? Each guide has its own gitthub repo, so please open an issue in the corresponding tracker.