2016-07-26 09:43:09 -05:00
|
|
|
package com.baeldung;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
public class BaeldungController {
|
2016-08-02 12:34:08 +03:00
|
|
|
|
|
|
|
|
@RequestMapping(method = { RequestMethod.GET }, value = { "/hello" })
|
|
|
|
|
public String sayHello(HttpServletResponse response) {
|
2016-07-26 09:43:09 -05:00
|
|
|
return "hello";
|
|
|
|
|
}
|
2016-08-02 12:34:08 +03:00
|
|
|
|
|
|
|
|
@RequestMapping(method = { RequestMethod.POST }, value = { "/baeldung" })
|
|
|
|
|
public String sayHelloPost(HttpServletResponse response) {
|
2016-07-26 09:43:09 -05:00
|
|
|
return "hello";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|