RedirectAttributes
![[Spring] RedirectAttributes](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FxQ9jK%2Fbtr3eWm2cKw%2FAAAAAAAAAAAAAAAAAAAAAAjmQ6n6ffhuBCLjKBB7b8yU9Th4Er7daB3L5tJcLn7G%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3D4ahC0F8qyThMoTsQObG8U5x4kxg%253D)
[Spring] RedirectAttributes
PRG 패턴이란? - POST방식으로 어떤 처리를 하고 Redirect하여 GET방식으로 특정한 페이지로 이동하는 패턴 스프링MVC에서는 PRG패턴을 위해 RedirectAttributes 타입을 제공한다. addAttribute( 키, 값) - 리다이렉트할때 쿼리 스트링이 되는 값을 지정 - URL에 쿼리 스트링으로 추가된다. addFlashAttribute( 키, 값 ) - 일회용으로 데이터를 전달하고 삭제되는 값을 지정 - URL에 보이지는 않지만 JSP에서 일회용으로 사용가능 ✔ RedirectAttributes 예시 👉testcontroller @GetMapping("/test01") public String test01(RedirectAttributes redirectAttributes) { ..