Add createDispatcherServlet hook point

Add an extra hook point in `AbstractDispatcherServletInitializer` to
customize the `DispatcherServlet`.

Issue: SPR-13222
This commit is contained in:
Stephane Nicoll
2015-07-13 14:43:06 +02:00
parent 84138abfd1
commit d738dddd8f
4 changed files with 32 additions and 6 deletions

View File

@@ -205,7 +205,7 @@ based equivalent of the above `web.xml` example:
`WebApplicationInitializer` is an interface provided by Spring MVC that ensures your
code-based configuration is detected and automatically used to initialize any Servlet 3
container. An abstract base class implementation of this interace named
container. An abstract base class implementation of this interface named
`AbstractDispatcherServletInitializer` makes it even easier to register the
`DispatcherServlet` by simply specifying its servlet mapping.
See <<mvc-container-config,Code-based Servlet container initialization>> for more details.
@@ -4462,6 +4462,9 @@ The `isAsyncSupported` protected method of `AbstractDispatcherServletInitializer
provides a single place to enable async support on the `DispatcherServlet` and all
filters mapped to it. By default this flag is set to `true`.
Finally, if you need to further customize the `DispatcherServlet` itself, you can
override the `createDispatcherServlet` method.

View File

@@ -525,6 +525,8 @@ public @interface MyTestConfig {
* When using GSON or Jackson 2.6+, the handler method return type is used to improve
serialization of parameterized types like `List<Foo>`.
* Default JSON prefix has been changed from "{} && " to the safer ")]}', " one.
* Protected `createDispatcherServlet` method in `AbstractDispatcherServletInitializer` to further
customize the `DispatcherServlet` instance to use.
=== WebSocket Messaging Improvements