Update information on WebApplicationContext hierarchy

Issue: SPR-16041
This commit is contained in:
Rossen Stoyanchev
2017-10-17 21:49:57 -04:00
parent cd634633d8
commit 32d78e60b6
7 changed files with 76 additions and 73 deletions

View File

@@ -346,8 +346,13 @@ server.addConnector(connector);
server.start();
----
You can also deploy as a WAR to any Servlet 3.1 container by wrapping the handler with
`ServletHttpHandlerAdapter` as a `Servlet`.
[NOTE]
====
To deploy as a WAR to a Servlet 3.1+ container, wrap `HttpHandler` with
`ServletHttpHandlerAdapter` and register that as a `Servlet`. Use
{api-spring-framework}/web/reactive/support/AbstractServletHttpHandlerAdapterInitializer.html[AbstractServletHttpHandlerAdapterInitializer]
to automate the required Servlet container configuration.
====

View File

@@ -161,6 +161,12 @@ Below is example configuration with a `WebApplicationContext` hierarchy:
}
----
[TIP]
====
If an application context hierarchy is not required, applications may return all
configuration via `getRootConfigClasses()` and `null` from `getServletConfigClasses()`.
====
And the `web.xml` equivalent:
[source,xml,indent=0]
@@ -195,6 +201,13 @@ And the `web.xml` equivalent:
</web-app>
----
[TIP]
====
If an application context hierarchy is not required, applications may configure a
"root" context only and leave the `contextConfigLocation` Servlet parameter empty.
====
[[mvc-servlet-special-bean-types]]