首页 > 编程语言 > 详细

什么时候会进行 SpringMVC重定向保存参数(FlashMap)?

时间:2019-11-21 13:55:28      阅读:128      评论:0      收藏:0      [点我收藏+]

SpringMVC重定向保存参数(FlashMap):
两种情况会保存参数:
    1. 当前视图为RedirectView,也即是说当前请求为重定向请求。
        org.springframework.web.servlet.view.RedirectView#renderMergedOutputModel!RequestContextUtils.saveOutputFlashMap(targetUrl, request, response);
        
    2. 当前处理方法HandlerMethod,其执行后的返回值为HttpEntity扩展类(HttpEntity.class.isAssignableFrom(returnType.getParameterType()) && !RequestEntity.class.isAssignableFrom(returnType.getParameterType()))。
        org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor#saveFlashAttributes!RequestContextUtils.saveOutputFlashMap(location, req, res);
    
内部跟踪以上两个方法,最终会调用org.springframework.web.servlet.support.SessionFlashMapManager#updateFlashMaps方法,以便于将FlashMap保存。

什么时候会进行 SpringMVC重定向保存参数(FlashMap)?

原文:https://www.cnblogs.com/hfultrastrong/p/11904655.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!