package hello;

import java.util.concurrent.atomic.AtomicLong;
import org.springframework.stereotype.Controller;
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 {

    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();

    @RequestMapping("/greeting")
    public @ResponseBody Greeting greeting(
            @RequestParam(value="name", required=false, defaultValue="World") String name) {
        return new Greeting(counter.incrementAndGet(),
                            String.format(template, name));
    }
}
@@ -60,58 +60,8 @@
 ng;%0A
-import org.springframework.stereotype.Controller;%0A
 impo
@@ -234,21 +234,27 @@
 .Res
-ponseBody;%0A%0A@
+tController;%0A%0A@Rest
 Cont
@@ -458,22 +458,8 @@
 lic 
-@ResponseBody 
 Gree
@@ -472,29 +472,16 @@
 reeting(
-%0A            
 @Request
@@ -675,8 +675,9 @@
 %0A    %7D%0A%7D
+%0A

Upgrade from @Controller/@ResponseBody to @RestController