This context will create, initialize and run an {@link EmbeddedServletContainer} bysearching for a single {@link EmbeddedServletContainerFactory} bean within the{@link ApplicationContext} itself. The {@link EmbeddedServletContainerFactory} is freeto use standard Spring concepts (such as dependency injection, lifecycle callbacks and property placeholder variables).
In addition, any {@link Servlet} or {@link Filter} beans defined in the context will beautomatically registered with the embedded Servlet container. In the case of a single Servlet bean, the '/' mapping will be used. If multiple Servlet beans are found then the lowercase bean name will be used as a mapping prefix. Any Servlet named 'dispatcherServlet' will always be mapped to '/'. Filter beans will be mapped to all URLs ('/*').
For more advanced configuration, the context can instead define beans that implement the {@link ServletContextInitializer} interface (most often{@link ServletRegistrationBean}s and/or {@link FilterRegistrationBean}s). To prevent double registration, the use of {@link ServletContextInitializer} beans will disableautomatic Servlet and Filter bean registration.
Although this context can be used directly, most developers should consider using the {@link AnnotationConfigEmbeddedWebApplicationContext} or{@link XmlEmbeddedWebApplicationContext} variants. @author Phillip Webb @author Dave Syer @see AnnotationConfigEmbeddedWebApplicationContext @see XmlEmbeddedWebApplicationContext @see EmbeddedServletContainerFactory
|
|