본문 바로가기

IT개발정보/spring and java

Spring Annotation

Spring Annotation

 

정의

 

 

 

종류

 

 

 

@RequestMapping

  • vlaue : 요청받을 URL 설정
  • method : 어떤 요청으로 받을지 정의 (GET, POST, PUT, DELETE등)

@RestController
public class MainController {
 
    @RequestMapping(value = "/main", method = RequestMethod.GET)
    public String Main(...) {
        ...
    }