Explorar el Código

Align start project with true start point of guide.

Craig Walls hace 13 años
padre
commit
8e2e25af10

+ 0
- 4
start/src/main/java/hello/Greeting.java Ver fichero

@@ -1,4 +0,0 @@
1
-package hello;
2
-
3
-public class Greeting {
4
-}

+ 7
- 0
start/src/main/java/hello/HelloWorldConfiguration.java Ver fichero

@@ -1,4 +1,11 @@
1 1
 package hello;
2 2
 
3
+import org.springframework.context.annotation.ComponentScan;
4
+import org.springframework.context.annotation.Configuration;
5
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
6
+
7
+@Configuration
8
+@EnableWebMvc
9
+@ComponentScan
3 10
 public class HelloWorldConfiguration {
4 11
 } 

+ 0
- 4
start/src/main/java/hello/HelloWorldController.java Ver fichero

@@ -1,4 +0,0 @@
1
-package hello;
2
-
3
-public class HelloWorldController {
4
-}

+ 19
- 1
start/src/main/java/hello/HelloWorldWebAppInitializer.java Ver fichero

@@ -1,4 +1,22 @@
1 1
 package hello;
2 2
 
3
-public class HelloWorldWebAppInitializer {
3
+import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
4
+
5
+public class HelloWorldWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
6
+
7
+	@Override
8
+	protected Class<?>[] getRootConfigClasses() {
9
+		return null;
10
+	}
11
+
12
+	@Override
13
+	protected Class<?>[] getServletConfigClasses() {
14
+		return new Class[] { HelloWorldConfiguration.class };
15
+	}
16
+
17
+	@Override
18
+	protected String[] getServletMappings() {
19
+		return new String[] { "/" };
20
+	}
21
+
4 22
 }