当前位置: 首页>>代码示例>>Java>>正文


Java RequestContextUtils.getFlashMapManager方法代码示例

本文整理汇总了Java中org.springframework.web.servlet.support.RequestContextUtils.getFlashMapManager方法的典型用法代码示例。如果您正苦于以下问题:Java RequestContextUtils.getFlashMapManager方法的具体用法?Java RequestContextUtils.getFlashMapManager怎么用?Java RequestContextUtils.getFlashMapManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.servlet.support.RequestContextUtils的用法示例。


在下文中一共展示了RequestContextUtils.getFlashMapManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderMergedOutputModel

import org.springframework.web.servlet.support.RequestContextUtils; //导入方法依赖的package包/类
/**
 * Convert model to request parameters and redirect to the given URL.
 * @see #appendQueryProperties
 * @see #sendRedirect
 */
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request,
		HttpServletResponse response) throws IOException {

	String targetUrl = createTargetUrl(model, request);
	targetUrl = updateTargetUrl(targetUrl, model, request, response);

	FlashMap flashMap = RequestContextUtils.getOutputFlashMap(request);
	if (!CollectionUtils.isEmpty(flashMap)) {
		UriComponents uriComponents = UriComponentsBuilder.fromUriString(targetUrl).build();
		flashMap.setTargetRequestPath(uriComponents.getPath());
		flashMap.addTargetRequestParams(uriComponents.getQueryParams());
		FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
		if (flashMapManager == null) {
			throw new IllegalStateException("FlashMapManager not found despite output FlashMap having been set");
		}
		flashMapManager.saveOutputFlashMap(flashMap, request, response);
	}

	sendRedirect(request, response, targetUrl, this.http10Compatible);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:27,代码来源:RedirectView.java

示例2: saveFlashMap

import org.springframework.web.servlet.support.RequestContextUtils; //导入方法依赖的package包/类
public static void saveFlashMap(FlashMap flashMap) {
    FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(getRequest());
    flashMapManager.saveOutputFlashMap(flashMap, getRequest(), getResponse());
}
 
开发者ID:thunderbird,项目名称:pungwecms,代码行数:5,代码来源:Utils.java

示例3: saveOutputFlashMap

import org.springframework.web.servlet.support.RequestContextUtils; //导入方法依赖的package包/类
/**
 * Save output flash map.
 *
 * @param flashMap
 *            the flash map
 * @param request
 *            the request
 * @param response
 *            the response
 */
public static void saveOutputFlashMap(FlashMap flashMap,HttpServletRequest request,HttpServletResponse response){
    FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
    flashMapManager.saveOutputFlashMap(flashMap, request, response);
}
 
开发者ID:venusdrogon,项目名称:feilong-spring,代码行数:15,代码来源:FlashMapUtil.java


注:本文中的org.springframework.web.servlet.support.RequestContextUtils.getFlashMapManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。