How can I access Spring Webflow FlowScope elements outside the flow?

后端 未结 1 1676
有刺的猬
有刺的猬 2021-01-06 01:00

EDIT: I didn\'t get any bites on this question, so I\'m adding a little more detail.

I have a Spring Webflow app (ver 2.3.2). I need to access multiple FlowScope

相关标签:
1条回答
  • 2021-01-06 01:59

    You can get the scope beans from RequestContext - context holder for request-specific statecurrent web application context. Access to request context in your validator method is by:

        import org.springframework.webflow.execution.RequestContext;
        import org.springframework.webflow.execution.RequestContextHolder;
    
        RequestContext requestContext = RequestContextHolder.getRequestContext();
        requestContext.getFlowScope().get("objectYouAreLookingFor");
    
    0 讨论(0)
提交回复
热议问题