Spring Boot
[SpringBoot] 매개변수(파라메터) 전달받아 출력하기
매개변수(파라메터) 전달받아 출력하기 @RequestParam : 쿼리스트링 방식으로 변수에 값을 저장해서 다른 페이지로 전달하는 어노테이션 http://localhost:8000/exam02/hello-name http://localhost:8000/exam02/hello-name?name=홍길동 ※ 정수 일 경우 (defaultValue = "0") 값을 정수로 무조건 넣어줘야 오류가 뜨지 않음 더보기 package com.example.controllerexam.controller.exam02; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.w..
2023. 10. 5. 10:47