本文整理匯總了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);
}
示例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());
}
示例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);
}