在 Springflow 中访问 flashattribute

Access flashattribute in Springflow

将值添加到 redirectAttrs.addFlashAttribute("some", value);,然后重定向到 Springflow

如何在Springflow中访问flashattributesome

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

尝试:

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

与:

@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;
    }
}