# PageFlowContextController.jpf Sample

This topic inludes the source code for the PageFlowContextController.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/pageFlow/

## Sample Source Code

`001 package handlingData.databinding.pageFlow; 002 003 import com.bea.wlw.netui.pageflow.FormData; 004 import com.bea.wlw.netui.pageflow.Forward; 005 import com.bea.wlw.netui.pageflow.PageFlowController; 006 007 /** 008 * @jpf:controller 009 * @jpf:view-properties view-properties:: 010 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 011 * <view-properties> 012 * <pageflow-object id="pageflow:/handlingData/databinding/pageFlow/PageFlowContextController.jpf"/> 013 * <pageflow-object id="action:begin.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm"> 014 * <property value="80" name="x"/> 015 * <property value="100" name="y"/> 016 * </pageflow-object> 017 * <pageflow-object id="action:submit.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm"> 018 * <property value="240" name="x"/> 019 * <property value="240" name="y"/> 020 * </pageflow-object> 021 * <pageflow-object id="action-call:@page:submit.jsp@#@action:submit.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm@"> 022 * <property value="240,240,204,204" name="elbowsX"/> 023 * <property value="144,174,174,221" name="elbowsY"/> 024 * <property value="South_1" name="fromPort"/> 025 * <property value="West_0" name="toPort"/> 026 * </pageflow-object> 027 * <pageflow-object id="page:submit.jsp"> 028 * <property value="240" name="x"/> 029 * <property value="100" name="y"/> 030 * </pageflow-object> 031 * <pageflow-object id="action-call:@page:show.jsp@#@action:begin.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm@"> 032 * <property value="80,80,80,80" name="elbowsX"/> 033 * <property value="196,170,170,144" name="elbowsY"/> 034 * <property value="North_1" name="fromPort"/> 035 * <property value="South_1" name="toPort"/> 036 * </pageflow-object> 037 * <pageflow-object id="page:show.jsp"> 038 * <property value="80" name="x"/> 039 * <property value="240" name="y"/> 040 * </pageflow-object> 041 * <pageflow-object id="forward:path#success#show.jsp#@action:submit.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm@"> 042 * <property value="204,160,160,116" name="elbowsX"/> 043 * <property value="232,232,232,232" name="elbowsY"/> 044 * <property value="West_1" name="fromPort"/> 045 * <property value="East_1" name="toPort"/> 046 * <property value="success" name="label"/> 047 * </pageflow-object> 048 * <pageflow-object id="formbeanprop:handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm#name#java.lang.String"/> 049 * <pageflow-object id="formbean:handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm"/> 050 * <pageflow-object id="forward:path#success#submit.jsp#@action:begin.do#handlingData.databinding.pageFlow.PageFlowContextController.SubmitForm@"> 051 * <property value="116,160,160,204" name="elbowsX"/> 052 * <property value="92,92,92,92" name="elbowsY"/> 053 * <property value="East_1" name="fromPort"/> 054 * <property value="West_1" name="toPort"/> 055 * <property value="success" name="label"/> 056 * </pageflow-object> 057 * </view-properties> 058 * :: 059 */ 060 public class PageFlowContextController extends PageFlowController 061 { 062 public SubmitForm formInstance = new SubmitForm(); 063 064 /** 065 * @jpf:action form="formInstance" 066 * @jpf:forward name="success" path="submit.jsp" 067 */ 068 protected Forward begin(SubmitForm form) 069 { 070 form.setName("John"); 071 072 return new Forward("success"); 073 } 074 075 /** 076 * @jpf:action 077 * @jpf:forward name="success" path="show.jsp" 078 */ 079 protected Forward submit(SubmitForm form) 080 { 081 return new Forward("success"); 082 } 083 084 /** 085 * FormData get and set methods may be overwritten by the Form Bean editor. 086 */ 087 public static class SubmitForm extends FormData 088 { 089 private String name; 090 091 public void setName(String name) 092 { 093 this.name = name; 094 } 095 096 public String getName() 097 { 098 return this.name; 099 } 100 } 101 }`