當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。