Document how to register annotated classes in a GenericWebApplicationContext

Closes gh-27778
This commit is contained in:
Sam Brannen
2022-01-27 15:47:21 +01:00
parent e32f94bf8c
commit 6647023151
4 changed files with 37 additions and 1 deletions

View File

@@ -7900,6 +7900,10 @@ init-param):
</web-app>
----
NOTE: For programmatic use cases, a `GenericWebApplicationContext` can be used as an
alternative to `AnnotationConfigWebApplicationContext`. See the
{api-spring-framework}/web/context/support/GenericWebApplicationContext.html[`GenericWebApplicationContext`]
javadoc for details.
[[beans-java-bean-annotation]]

View File

@@ -84,6 +84,11 @@ NOTE: In addition to using the ServletContext API directly, you can also extend
`AbstractAnnotationConfigDispatcherServletInitializer` and override specific methods
(see the example under <<mvc-servlet-context-hierarchy>>).
NOTE: For programmatic use cases, a `GenericWebApplicationContext` can be used as an
alternative to `AnnotationConfigWebApplicationContext`. See the
{api-spring-framework}/web/context/support/GenericWebApplicationContext.html[`GenericWebApplicationContext`]
javadoc for details.
The following example of `web.xml` configuration registers and initializes the `DispatcherServlet`:
[source,xml,indent=0,subs="verbatim,quotes"]