Skip to content

Commit abb54b9

Browse files
author
eugenp
committed
no xml support
1 parent 813295c commit abb54b9

3 files changed

Lines changed: 34 additions & 52 deletions

File tree

‎spring-mvc-no-xml/src/main/java/org/baeldung/servlet/WebApp.java‎

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.baeldung.servlet;
2+
3+
import org.baeldung.spring.ClientWebConfig;
4+
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
5+
6+
public class WebAppNew extends AbstractAnnotationConfigDispatcherServletInitializer {
7+
8+
public WebAppNew() {
9+
super();
10+
}
11+
12+
// API
13+
14+
@Override
15+
protected Class<?>[] getRootConfigClasses() {
16+
return null;
17+
}
18+
19+
@Override
20+
protected Class<?>[] getServletConfigClasses() {
21+
return new Class<?>[] { ClientWebConfig.class };
22+
}
23+
24+
@Override
25+
protected String[] getServletMappings() {
26+
return new String[] { "/" };
27+
}
28+
29+
}

spring-mvc-no-xml/src/main/java/org/baeldung/servlet/NewWebApp.java renamed to spring-mvc-no-xml/src/main/java/org/baeldung/servlet/WebAppOld.java

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.baeldung.servlet;
22

3+
4+
//public class WebApp implements WebApplicationInitializer {
35
//
4-
//public class NewWebApp extends AbstractAnnotationConfigDispatcherServletInitializer {
5-
//
6-
// public NewWebApp() {
6+
// public WebApp() {
77
// super();
88
// }
99
//
@@ -18,23 +18,7 @@
1818
//
1919
// final Dynamic servlet = servletContext.addServlet("mvc", new DispatcherServlet(root));
2020
// servlet.setLoadOnStartup(1);
21-
// servlet.addMapping("/*");
22-
// }
23-
//
24-
// @Override
25-
// protected Class<?>[] getRootConfigClasses() {
26-
// return null;
27-
// }
28-
//
29-
// @Override
30-
// protected Class<?>[] getServletConfigClasses() {
31-
// return new Class<?>[] { ClientWebConfig.class };
32-
// }
33-
//
34-
// @Override
35-
// protected String[] getServletMappings() {
36-
// return new String[] { "/*" };
21+
// servlet.addMapping("/");
3722
// }
3823
//
39-
//}
40-
24+
// }

0 commit comments

Comments
 (0)