Results 1 to 2 of 2

Thread: accessing to command object

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    13

    Default 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. #2
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    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

Similar Threads

  1. Replies: 8
    Last Post: Jun 12th, 2007, 01:45 PM
  2. Accessing Service Objects in Actions
    By curtney in forum Web Flow
    Replies: 8
    Last Post: Dec 29th, 2006, 02:55 AM
  3. Replies: 3
    Last Post: Jun 19th, 2005, 04:53 PM
  4. Accessing methods from beans in the Flow Scope
    By jackcholt in forum Web Flow
    Replies: 4
    Last Post: May 26th, 2005, 10:28 PM
  5. Replies: 3
    Last Post: May 4th, 2005, 08:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •