#20 Spring 0

Open
primeranary wants to merge 1 commits from primeranary/ZCW-SpringZero:master into master
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      complete/src/main/java/hello/GreetingController.java

+ 6
- 0
complete/src/main/java/hello/GreetingController.java View File

@@ -16,4 +16,10 @@ public class GreetingController {
16 16
         return new Greeting(counter.incrementAndGet(),
17 17
                             String.format(template, name));
18 18
     }
19
+
20
+    @RequestMapping("/greeting?name=Another")
21
+    public Greeting greeting1(@RequestParam(value="name", defaultValue="Another") String name) {
22
+        return new Greeting(counter.incrementAndGet(),
23
+                String.format(template, name));
24
+    }
19 25
 }