Spring RedirectAttributes: addAttribute() vs addFlashAttribute()

前端 未结 3 1550
故里飘歌
故里飘歌 2020-11-28 03:00

My understanding so far is on our controller request mapping method we can specify RedirectAttributes parameter and populate it with attributes for when the request

3条回答
  •  伪装坚强ぢ
    2020-11-28 03:37

    Javadoc description: "A FlashMap provides a way for one request to store attributes intended for use in another. This is most commonly needed when redirecting from one URL to another -- e.g. the Post/Redirect/Get pattern. A FlashMap is saved before the redirect (typically in the session) and is made available after the redirect and removed immediately."

提交回复
热议问题