diff --git a/spring-webflow/src/main/java/org/springframework/webflow/action/ViewFactoryActionAdapter.java b/spring-webflow/src/main/java/org/springframework/webflow/action/ViewFactoryActionAdapter.java new file mode 100644 index 00000000..cfe6a232 --- /dev/null +++ b/spring-webflow/src/main/java/org/springframework/webflow/action/ViewFactoryActionAdapter.java @@ -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"); + } +} \ No newline at end of file