|
3 | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
4 | 4 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" |
5 | 5 | version="3.0"> |
| 6 | + |
| 7 | + <!-- Uncommented, this disallows org.springframework.web.SpringServletContainerInitializer to run and execute |
| 8 | + application initializers. --> |
| 9 | + <!--<absolute-ordering> |
| 10 | + </absolute-ordering>--> |
6 | 11 |
|
7 | 12 | <!-- load root application context --> |
8 | | - <context-param> |
| 13 | + <!--<listener> |
| 14 | + <listener-class> |
| 15 | + org.springframework.web.context.ContextLoaderListener |
| 16 | + </listener-class> |
| 17 | + </listener>--> |
| 18 | + <!--<context-param> |
9 | 19 | <param-name>contextConfigLocation</param-name> |
10 | 20 | <param-value>/WEB-INF/rootApplicationContext.xml</param-value> |
11 | | - </context-param> |
12 | | - <listener> |
13 | | - <listener-class> |
14 | | - org.springframework.web.context.ContextLoaderListener |
15 | | - </listener-class> |
16 | | - </listener> |
17 | | - |
| 21 | + </context-param>--> |
| 22 | + <!--<context-param> |
| 23 | + <param-name>contextClass</param-name> |
| 24 | + <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value> |
| 25 | + </context-param> |
| 26 | + <context-param> |
| 27 | + <param-name>contextConfigLocation</param-name> |
| 28 | + <param-value>com.baeldung.contexts.config.RootApplicationConfig, com.baeldung.contexts.config.NormalWebAppConfig</param-value> |
| 29 | + </context-param>--> |
| 30 | + <!--<context-param> |
| 31 | + <param-name>contextConfigLocation</param-name> |
| 32 | + <param-value>org.baeldung.bean.config</param-value> |
| 33 | + </context-param>--> |
| 34 | + |
18 | 35 | <!-- secure web app context --> |
19 | | - <servlet> |
| 36 | + <!--<servlet> |
20 | 37 | <servlet-name>secure-webapp</servlet-name> |
21 | | - <servlet-class> |
22 | | - org.springframework.web.servlet.DispatcherServlet |
23 | | - </servlet-class> |
24 | | - <load-on-startup>1</load-on-startup> |
25 | | - <init-param> |
26 | | - <param-name>contextConfigLocation</param-name> |
27 | | - <param-value>/WEB-INF/secure-webapp-servlet.xml</param-value> |
28 | | - </init-param> |
| 38 | + <servlet-class> |
| 39 | + org.springframework.web.servlet.DispatcherServlet |
| 40 | + </servlet-class> |
| 41 | + <init-param> |
| 42 | + <param-name>contextConfigLocation</param-name> |
| 43 | + <param-value>/WEB-INF/secure-webapp-servlet.xml</param-value> |
| 44 | + </init-param> |
| 45 | + <load-on-startup>1</load-on-startup> |
29 | 46 | </servlet> |
30 | 47 | <servlet-mapping> |
31 | 48 | <servlet-name>secure-webapp</servlet-name> |
32 | 49 | <url-pattern>/s/api/*</url-pattern> |
33 | | - </servlet-mapping> |
| 50 | + </servlet-mapping>--> |
34 | 51 |
|
35 | 52 | <!-- normal web app context --> |
36 | | - <servlet> |
| 53 | + <!--<servlet> |
37 | 54 | <servlet-name>normal-webapp</servlet-name> |
38 | 55 | <servlet-class> |
39 | 56 | org.springframework.web.servlet.DispatcherServlet |
|
43 | 60 | <servlet-mapping> |
44 | 61 | <servlet-name>normal-webapp</servlet-name> |
45 | 62 | <url-pattern>/api/*</url-pattern> |
46 | | - </servlet-mapping> |
47 | | - |
| 63 | + </servlet-mapping>--> |
| 64 | + <!-- normal webapp with annotations-based context --> |
48 | 65 | <servlet> |
49 | | - <servlet-name>test-mvc</servlet-name> |
| 66 | + <servlet-name>normal-webapp-annotations</servlet-name> |
50 | 67 | <servlet-class> |
51 | 68 | org.springframework.web.servlet.DispatcherServlet |
52 | 69 | </servlet-class> |
| 70 | + <init-param> |
| 71 | + <param-name>contextClass</param-name> |
| 72 | + <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value> |
| 73 | + </init-param> |
53 | 74 | <init-param> |
54 | 75 | <param-name>contextConfigLocation</param-name> |
55 | | - <param-value>/WEB-INF/test-mvc.xml</param-value> |
| 76 | + <param-value>com.baeldung.contexts.config.NormalWebAppConfig</param-value> |
56 | 77 | </init-param> |
57 | 78 | <load-on-startup>1</load-on-startup> |
58 | 79 | </servlet> |
59 | | - |
60 | 80 | <servlet-mapping> |
61 | | - <servlet-name>test-mvc</servlet-name> |
62 | | - <url-pattern>/test/*</url-pattern> |
| 81 | + <servlet-name>normal-webapp-annotations</servlet-name> |
| 82 | + <url-pattern>/api-ann/*</url-pattern> |
63 | 83 | </servlet-mapping> |
64 | 84 |
|
65 | 85 | <welcome-file-list> |
|
0 commit comments