Skip to content

Commit e9e91d8

Browse files
author
eugenp
committed
MVC work
1 parent 819fb33 commit e9e91d8

3 files changed

Lines changed: 51 additions & 43 deletions

File tree

spring-mvc-no-xml/src/main/java/org/baeldung/spring/web/config/ClientWebConfig.java renamed to spring-mvc-no-xml/src/main/java/org/baeldung/spring/ClientWebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.baeldung.spring.web.config;
1+
package org.baeldung.spring;
22

33
import org.springframework.context.annotation.Bean;
44
import org.springframework.context.annotation.Configuration;

‎spring-mvc-no-xml/src/main/webapp/WEB-INF/web.xml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
77
id="WebApp_ID" version="3.0">
88

9-
<display-name>Spring MVC Application</display-name>
9+
<display-name>Spring MVC No XML Application</display-name>
1010

1111
<!-- Spring root -->
12+
<context-param>
13+
<param-name>contextClass</param-name>
14+
<param-value>
15+
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
16+
</param-value>
17+
</context-param>
1218
<context-param>
1319
<param-name>contextConfigLocation</param-name>
14-
<param-value>/WEB-INF/mvc-servlet.xml</param-value>
20+
<param-value>org.baeldung.spring</param-value>
1521
</context-param>
1622

1723
<listener>
Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
3-
xsi:schemaLocation="
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
4+
xsi:schemaLocation="
45
http://java.sun.com/xml/ns/javaee
5-
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
6+
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
7+
id="WebApp_ID" version="3.0">
68

7-
<display-name>Spring MVC Application</display-name>
9+
<display-name>Spring MVC Application</display-name>
810

9-
<!-- Spring root -->
10-
<context-param>
11-
<param-name>contextClass</param-name>
12-
<param-value>
13-
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
14-
</param-value>
15-
</context-param>
16-
<context-param>
17-
<param-name>contextConfigLocation</param-name>
18-
<param-value>org.baeldung.spring</param-value>
19-
</context-param>
11+
<!-- Spring root -->
12+
<context-param>
13+
<param-name>contextClass</param-name>
14+
<param-value>
15+
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
16+
</param-value>
17+
</context-param>
18+
<context-param>
19+
<param-name>contextConfigLocation</param-name>
20+
<param-value>org.baeldung.spring</param-value>
21+
</context-param>
2022

21-
<listener>
22-
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
23-
</listener>
23+
<listener>
24+
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
25+
</listener>
2426

25-
<!-- Spring child -->
26-
<servlet>
27-
<servlet-name>mvc</servlet-name>
28-
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
29-
<load-on-startup>1</load-on-startup>
30-
</servlet>
31-
<servlet-mapping>
32-
<servlet-name>mvc</servlet-name>
33-
<url-pattern>/</url-pattern>
34-
</servlet-mapping>
27+
<!-- Spring child -->
28+
<servlet>
29+
<servlet-name>mvc</servlet-name>
30+
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
31+
<load-on-startup>1</load-on-startup>
32+
</servlet>
33+
<servlet-mapping>
34+
<servlet-name>mvc</servlet-name>
35+
<url-pattern>/</url-pattern>
36+
</servlet-mapping>
3537

36-
<!-- Spring Security -->
37-
<filter>
38-
<filter-name>springSecurityFilterChain</filter-name>
39-
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
40-
</filter>
41-
<filter-mapping>
42-
<filter-name>springSecurityFilterChain</filter-name>
43-
<url-pattern>/*</url-pattern>
44-
</filter-mapping>
38+
<!-- Spring Security -->
39+
<filter>
40+
<filter-name>springSecurityFilterChain</filter-name>
41+
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
42+
</filter>
43+
<filter-mapping>
44+
<filter-name>springSecurityFilterChain</filter-name>
45+
<url-pattern>/*</url-pattern>
46+
</filter-mapping>
4547

46-
<!-- <welcome-file-list> -->
47-
<!-- <welcome-file>index.html</welcome-file> -->
48-
<!-- </welcome-file-list> -->
48+
<!-- <welcome-file-list> -->
49+
<!-- <welcome-file>index.html</welcome-file> -->
50+
<!-- </welcome-file-list> -->
4951

5052
</web-app>

0 commit comments

Comments
 (0)