@@ -156,10 +156,9 @@ in the following diagram. The pattern-savvy reader will recognize that the
156
156
`DispatcherServlet` is an expression of the "Front Controller" design pattern (this is a
157
157
pattern that Spring Web MVC shares with many other leading web frameworks).
158
158
159
+ .The request processing workflow in Spring Web MVC (high level)
159
160
image::images/mvc.png[width=400]
160
161
161
- The request processing workflow in Spring Web MVC (high level)
162
-
163
162
The `DispatcherServlet` is an actual `Servlet` (it inherits from the `HttpServlet` base
164
163
class), and as such is declared in the `web.xml` of your web application. You need to
165
164
map requests that you want the `DispatcherServlet` to handle, by using a URL mapping in
@@ -221,8 +220,8 @@ scoped. In the Web MVC framework, each `DispatcherServlet` has its own
221
220
`WebApplicationContext`. These inherited beans can be overridden in the servlet-specific
222
221
scope, and you can define new scope-specific beans local to a given Servlet instance.
223
222
224
- .Context hierarchy in Spring Web MVC
225
- image::images/mvc-contexts.gif [width=400]
223
+ .Typical context hierarchy in Spring Web MVC
224
+ image::images/mvc-context-hierarchy.png [width=400]
226
225
227
226
Upon initialization of a `DispatcherServlet`, Spring MVC looks for a file named
228
227
__[servlet-name]-servlet.xml__ in the `WEB-INF` directory of your web application and
@@ -252,8 +251,13 @@ With the above Servlet configuration in place, you will need to have a file call
252
251
Spring Web MVC-specific components (beans). You can change the exact location of this
253
252
configuration file through a Servlet initialization parameter (see below for details).
254
253
255
- It is also possible to have just one root context for single DispatcherServlet scenarios
256
- by setting an empty contextConfigLocation servlet init parameter, as shown below:
254
+ It is also possible to have just one root context for single DispatcherServlet scenarios.
255
+
256
+ .Single root context in Spring Web MVC
257
+ image::images/mvc-root-context.png[width=400]
258
+
259
+ This can be configured by setting an empty contextConfigLocation servlet init parameter,
260
+ as shown below:
257
261
258
262
[source,xml,indent=0]
259
263
[subs="verbatim,quotes"]
0 commit comments