読者です 読者をやめる 読者になる 読者になる

Fight the Future

何かを始めたら、半分成功したのと同じ

Use @GetMapping, @PostMapping in Spring 4.3 or later

Spring java

I always use @RequestMapping in Controller.

@Controller
public class TestController {
    @RequestMapping(value = "test", method = RequestMethod.GET)
    public String index() {

But in Spring 4.3, @GetMapping and @PostMappiing are provided. I was not sure about that.

So we don't need to write such a long statement. Just write below:

@Controller
public class TestController {
    @GetMapping("test")
    public String index() {