@RequestMapping(path=”/경로명”, method=”메서드 형식”)
@RequestMapping(value="/info", method=RequestMethod.GET)
public String getInfo(){
…
}
@RequestMapping(value="/info", method=RequestMethod.POST)
public String postInfo(){
…
}
@RequestMapping({“/test1”,”/test2”})
@RequestMapping(“/info/{userId}”)
@RequestMapping(“/info/{userId}”)
public void memberInfo(@PathVariable String userId){
…
}
@PathVariable[(value=”변수명”)]
매개변수의 타입 앞에 쓰여 매핑할 경로변수를 설정 할 수 있음
@RequestMapping(value="/member", method=@RequestMethod.POST, produces="application/json")
"application/json"
로 변경@RequestMapping(value="/member", method=@RequestMethod.POST, consumes="application/json")
"application/json"
로 변경