From 59a050f3b91c9d7d93beb73acedfebbdaa963a8a Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Mon, 28 Apr 2014 16:51:10 +0200 Subject: [PATCH] Include more guidance about DispatcherServlet context Also update comment in XSD. Issue: SPR-11703 --- .../web/servlet/config/spring-mvc-4.0.xsd | 2 +- src/asciidoc/index.adoc | 35 ++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.0.xsd b/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.0.xsd index 293a09cb03..5846e0f391 100644 --- a/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.0.xsd +++ b/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.0.xsd @@ -15,7 +15,7 @@ + + contextConfigLocation + /WEB-INF/root-context.xml + + + dispatcher + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + + + 1 + + + dispatcher + /* + + + org.springframework.web.context.ContextLoaderListener + + +---- + + The `WebApplicationContext` is an extension of the plain `ApplicationContext` that has some extra features necessary for web applications. It differs from a normal `ApplicationContext` in that it is capable of resolving themes (see @@ -31888,7 +31919,9 @@ To enable MVC Java config add the annotation `@EnableWebMvc` to one of your } ---- -To achieve the same in XML use the `mvc:annotation-driven` element: +To achieve the same in XML use the `mvc:annotation-driven` element in your +DispatcherServlet context (or in your root context if you have no DispatcherServlet +context defined): [source,xml,indent=0] [subs="verbatim,quotes"] -- GitLab