view factory action adapter

This commit is contained in:
Keith Donald
2007-11-07 23:14:52 +00:00
parent 6ecf0c047f
commit efdc1fcd28

View File

@@ -0,0 +1,22 @@
package org.springframework.webflow.action;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.execution.ViewFactory;
/**
* Simple adapter that adapts a view factory render cycle to the action interface.
* @author Keith Donald
*/
public class ViewFactoryActionAdapter extends AbstractAction {
private ViewFactory viewFactory;
public ViewFactoryActionAdapter(ViewFactory viewFactory) {
this.viewFactory = viewFactory;
}
protected Event doExecute(RequestContext context) throws Exception {
viewFactory.getView(context).render();
return new Event(this, "success");
}
}