package com.example;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class GreetingController {

	@RequestMapping("/greet")
	@ResponseBody
	public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
		model.addAttribute("name", name);
		return "greeting";
	}
}

@@ -15,16 +15,64 @@
 ample;%0A%0A
+import java.util.concurrent.atomic.AtomicLong;%0A%0A
 import o
@@ -113,16 +113,16 @@
 roller;%0A
-
 import o
@@ -383,16 +383,126 @@
 ller %7B%0A%0A
+%09private static final String template = %22Hello, %25s!%22;%0A%09private final AtomicLong counter = new AtomicLong();%0A%09%0A
 %09@Reques
@@ -521,25 +521,13 @@
 reet
-%22)%0A%09@ResponseBody
+ing%22)
 %0A%09pu
@@ -677,16 +677,16 @@
  name);%0A
-
 %09%09return
@@ -701,10 +701,230 @@
 ng%22;%0A%09%7D%0A
+%09%0A%09%0A%09@ResponseBody%0A%09@RequestMapping(%22/greet%22)%0A%09public Greeting greeting(@RequestParam(value=%22name%22, defaultValue=%22World%22) String name)%7B%0A%09%09return new Greeting(counter.incrementAndGet(), String.format(template, name));%0A%09%7D%0A
 %7D%0A

fix rest bug