
이런식으로 th:href 안에 소괄호를 만들어 파라미터값을 전달할 수 있다.
<a th:href="|@{/trainer/simpleInfo(trainerId=${review.trainerId})}|"
th:text="${review.reservationId}"></a>
@GetMapping("/simpleInfo")
public String simpleInfo(@RequestParam String trainerId, Model model) {
return "trainer/simpleInfo";
}
@RequestParam은 생략 가능하다.
'스프링 > Thymeleaf' 카테고리의 다른 글
[Thymeleaf] 다양한 연산자 (2) | 2022.09.23 |
---|---|
[Thymeleaf] html -> html 다이렉트로 파라미터 값 전달하기 (0) | 2022.09.22 |
[Thymeleaf] text 기능으로 스프링 컨트롤러에서 값 가져오기 (0) | 2022.09.22 |