Access flashattribute in Springflow

耗尽温柔 提交于 2020-01-13 06:58:10

问题


Added value to redirectAttrs.addFlashAttribute("some", value); and then redirect to Springflow

How to access flashattribute some in Springflow?

<on-start>
 <evaluate expression="do.Action(???)" result="flowScope.someobject" />
</on-start>

回答1:


try:

<evaluate expression="webFlowUtils.getFlashAttribute(externalContext, 'some')"/>

with:

@Component
public final class WebFlowUtils {

    public Object getFlashAttribute(ExternalContext context, String attributeName) {
        Map<String, ?> flashMap = RequestContextUtils.getInputFlashMap((HttpServletRequest) context.getNativeRequest());
        return flashMap != null ? flashMap.get(attributeName) : null;
    }
}


来源:https://stackoverflow.com/questions/38635640/access-flashattribute-in-springflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!