View Full Version : accessing to command object
Armen
May 25th, 2005, 07:59 AM
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?
klr8
May 25th, 2005, 12:44 PM
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:
String flowExecutionId=request.getParameter("_flowExecutionId");
FlowExecution flowExecution=(FlowExecution)WebUtils.getRequiredS essionAttribute(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
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.