# ActionFormController.jpf Sample

This topic inludes the source code for the ActionFormController.jpf Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/handlingData/databinding/actionForm/

## Sample Source Code

`001 package handlingData.databinding.actionForm; 002 import com.bea.wlw.netui.pageflow.FormData; 003 import com.bea.wlw.netui.pageflow.Forward; 004 import com.bea.wlw.netui.pageflow.PageFlowController; 005 006 /** 007 * @jpf:controller 008 * @jpf:view-properties view-properties:: 009 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 010 * <view-properties> 011 * <pageflow-object id="pageflow:/handlingData/databinding/actionForm/ActionFormController.jpf"/> 012 * <pageflow-object id="action:begin.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm"> 013 * <property value="160" name="x"/> 014 * <property value="100" name="y"/> 015 * </pageflow-object> 016 * <pageflow-object id="action:submit.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm"> 017 * <property value="280" name="x"/> 018 * <property value="200" name="y"/> 019 * </pageflow-object> 020 * <pageflow-object id="page:submit.jsp"> 021 * <property value="280" name="x"/> 022 * <property value="100" name="y"/> 023 * </pageflow-object> 024 * <pageflow-object id="page:show.jsp"> 025 * <property value="380" name="x"/> 026 * <property value="320" name="y"/> 027 * </pageflow-object> 028 * <pageflow-object id="forward:path#success#submit.jsp#@action:begin.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm@"> 029 * <property value="196,220,220,244" name="elbowsX"/> 030 * <property value="92,92,92,92" name="elbowsY"/> 031 * <property value="East_1" name="fromPort"/> 032 * <property value="West_1" name="toPort"/> 033 * <property value="success" name="label"/> 034 * </pageflow-object> 035 * <pageflow-object id="forward:path#success#show.jsp#@action:submit.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm@"> 036 * <property value="316,330,330,344" name="elbowsX"/> 037 * <property value="203,203,312,312" name="elbowsY"/> 038 * <property value="East_2" name="fromPort"/> 039 * <property value="West_1" name="toPort"/> 040 * <property value="success" name="label"/> 041 * </pageflow-object> 042 * <pageflow-object id="formbeanprop:handlingData.databinding.actionForm.ActionFormController.SubmitForm#name#java.lang.String"/> 043 * <pageflow-object id="formbean:handlingData.databinding.actionForm.ActionFormController.SubmitForm"/> 044 * <pageflow-object id="action:toDatabindingSamplesHome.do"> 045 * <property value="160" name="x"/> 046 * <property value="320" name="y"/> 047 * </pageflow-object> 048 * <pageflow-object id="action-call:@page:show.jsp@#@action:submit.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm@"> 049 * <property value="344,330,330,316" name="elbowsX"/> 050 * <property value="312,312,192,192" name="elbowsY"/> 051 * <property value="West_1" name="fromPort"/> 052 * <property value="East_1" name="toPort"/> 053 * </pageflow-object> 054 * <pageflow-object id="action-call:@page:show.jsp@#@action:begin.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm@"> 055 * <property value="344,270,270,196" name="elbowsX"/> 056 * <property value="312,312,103,103" name="elbowsY"/> 057 * <property value="West_1" name="fromPort"/> 058 * <property value="East_2" name="toPort"/> 059 * </pageflow-object> 060 * <pageflow-object id="action-call:@page:show.jsp@#@action:toDatabindingSamplesHome.do@"> 061 * <property value="344,270,270,196" name="elbowsX"/> 062 * <property value="312,312,312,312" name="elbowsY"/> 063 * <property value="West_1" name="fromPort"/> 064 * <property value="East_1" name="toPort"/> 065 * </pageflow-object> 066 * <pageflow-object id="action-call:@page:submit.jsp@#@action:submit.do#handlingData.databinding.actionForm.ActionFormController.SubmitForm@"> 067 * <property value="280,280,280,280" name="elbowsX"/> 068 * <property value="144,150,150,156" name="elbowsY"/> 069 * <property value="South_1" name="fromPort"/> 070 * <property value="North_1" name="toPort"/> 071 * </pageflow-object> 072 * </view-properties> 073 * :: 074 */ 075 public class ActionFormController extends PageFlowController 076 { 077 078 079 // Uncomment this declaration to access Global.app. 080 // 081 // protected global.Global globalApp; 082 // 083 084 // For an example of page flow exception handling see the example "catch" and "exception-handler" 085 // annotations in {project}/WEB-INF/src/global/Global.app 086 087 /** 088 * This method represents the point of entry into the pageflow 089 * @jpf:action 090 * @jpf:forward name="success" path="submit.jsp" 091 */ 092 protected Forward begin(SubmitForm form) 093 { 094 // Pre-populates the HTML form with the value "John". 095 form.setName( "John" ); 096 097 return new Forward("success", form); 098 } 099 100 /** 101 * @jpf:action 102 * @jpf:forward name="success" path="show.jsp" 103 */ 104 protected Forward submit(SubmitForm form) 105 { 106 return new Forward("success", form); 107 } 108 109 public static class SubmitForm extends FormData 110 { 111 private String name; 112 113 public void setName(String name) 114 { 115 this.name = name; 116 } 117 118 public String getName() 119 { 120 return this.name; 121 } 122 } 123 124 125 }`