问题
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