本文整理汇总了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);
}