Announcement Announcement Module
Collapse
No announcement yet.
accessing to command object Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • accessing to command object

    I need have reference to command object from other place. I use DWR technology and I only have references to request session and spring context. But how can I get access to my command object created in flow action?

  • #2
    If you're using the default HttpSessionFlowExecutionStorage, the FlowExecutions are actually stored in the HttpSession, so if you can get hold of the flow execution id (e.g. from the request), you could do something like this:

    Code:
    String flowExecutionId=request.getParameter("_flowExecutionId");
    FlowExecution flowExecution=(FlowExecution)WebUtils.getRequiredSessionAttribute(request, flowExecutionId);
    Event event=new ServletEvent(request, response);
    RequestContext context=new StateContextImpl(event, flowExecution);
    FormObjectAccessor accessor=new FormObjectAccessor(context);
    Object myFormObject=accessor.getFormObject("myFormObject", ScopeType.FLOW);
    Erwin

    Comment

    Working...
    X