스프링 어노테이션 - @RequestParam

G-NOTE·2021년 11월 22일
0

Spring

목록 보기
8/14

@RequestParam이란

  • 스프링은 HTTP 요청 파라미터를 @RequestParam으로 받을 수 있다.
@PostMapping("/requestParamEx")
public String requestParamEx(@requestParam("username") String username) {
  ...
}
String username = request.getParameter("username");
  • 위 두 코드가 거의 유사한 개념이라고 보면 된다.

  • @RequestParam은 GET 쿼리 파라미터, POST Form 방식을 모두 지원한다.

profile
FE Developer

0개의 댓글