"스프링 @RequestMapping"의 두 판 사이의 차이

41번째 줄: 41번째 줄:
* [[스프링 애노테이션]]
* [[스프링 애노테이션]]
* [[스프링부트 프로젝트 bootweb1]]
* [[스프링부트 프로젝트 bootweb1]]
* [[스프링 쿼리스트링 얻기]]
* [[스프링 쿼리스트링 얻기 getQueryString()]]


==참고 자료==
==참고 자료==

2017년 4월 12일 (수) 17:50 판

1 개요

스프링 @RequestMapping
@RequestMapping("/")
public String home() {
	 return "Hello bootweb!";
}
@RequestMapping(path = { "/greet", "/hello" })
public String greet() {
	 return "안녕하세요";
}
@RequestMapping(value = "/hello/world", method = RequestMethod.GET)
@ResponseBody
public String helloWorld() {
    return "Hello, world!";
}
@RequestMapping("/greet/{name}")
public String greet(@PathVariable("name") String name) {
	return "안녕하세요? " + name + "님 반갑습니다.^^";
}
@RequestMapping(method=RequestMethod.GET, value={"/movies","/movies/{id}"})
public String getMovieDetails(Model model,
     @RequestParam(value="id", required=false) Long id,
     @PathVariable("id") Long id2)
{
}

2 같이 보기

3 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}