# Controller.jpf Sample

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

## Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/struts/validation/

## Sample Source Code

`001 package struts.validation; 002 003 import com.bea.wlw.netui.pageflow.*; 004 import org.apache.struts.action.*; 005 import javax.servlet.http.*; 006 007 008 /** 009 * @jpf:message-resources resources="validation.ValidationMessages" 010 * @jpf:view-properties view-properties:: 011 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 012 * <view-properties> 013 * <pageflow-object id="pageflow:/validation/Controller.jpf"/> 014 * <pageflow-object id="action:begin.do"> 015 * <property value="80" name="x"/> 016 * <property value="300" name="y"/> 017 * </pageflow-object> 018 * <pageflow-object id="action:doBasic.do"> 019 * <property value="420" name="x"/> 020 * <property value="400" name="y"/> 021 * </pageflow-object> 022 * <pageflow-object id="action:doValidator.do"> 023 * <property value="420" name="x"/> 024 * <property value="200" name="y"/> 025 * </pageflow-object> 026 * <pageflow-object id="page:index.jsp"> 027 * <property value="420" name="x"/> 028 * <property value="300" name="y"/> 029 * </pageflow-object> 030 * <pageflow-object id="external-jpf:basic/Controller.jpf"> 031 * <property value="420" name="x"/> 032 * <property value="520" name="y"/> 033 * </pageflow-object> 034 * <pageflow-object id="external-jpf:validator/Controller.jpf"> 035 * <property value="420" name="x"/> 036 * <property value="80" name="y"/> 037 * </pageflow-object> 038 * <pageflow-object id="forward:path#index#index.jsp#@action:begin.do@"> 039 * <property value="116,250,250,384" name="elbowsX"/> 040 * <property value="292,292,292,292" name="elbowsY"/> 041 * <property value="East_1" name="fromPort"/> 042 * <property value="West_1" name="toPort"/> 043 * <property value="index" name="label"/> 044 * </pageflow-object> 045 * <pageflow-object id="forward:path#basicValidationPageFlow#basic/Controller.jpf#@action:doBasic.do@"> 046 * <property value="420,420,420,420" name="elbowsX"/> 047 * <property value="444,460,460,476" name="elbowsY"/> 048 * <property value="South_1" name="fromPort"/> 049 * <property value="North_1" name="toPort"/> 050 * <property value="basicValidationPageFlow" name="label"/> 051 * </pageflow-object> 052 * <pageflow-object id="forward:path#validatorPageFlow#validator/Controller.jpf#@action:doValidator.do@"> 053 * <property value="420,420,420,420" name="elbowsX"/> 054 * <property value="156,140,140,124" name="elbowsY"/> 055 * <property value="North_1" name="fromPort"/> 056 * <property value="South_1" name="toPort"/> 057 * <property value="validatorPageFlow" name="label"/> 058 * </pageflow-object> 059 * <pageflow-object id="action-call:@external-jpf:basic/Controller.jpf@#@action:begin.do@"> 060 * <property value="384,250,250,116" name="elbowsX"/> 061 * <property value="512,512,303,303" name="elbowsY"/> 062 * <property value="West_1" name="fromPort"/> 063 * <property value="East_2" name="toPort"/> 064 * </pageflow-object> 065 * <pageflow-object id="action-call:@external-jpf:validator/Controller.jpf@#@action:begin.do@"> 066 * <property value="384,250,250,116" name="elbowsX"/> 067 * <property value="72,72,281,281" name="elbowsY"/> 068 * <property value="West_1" name="fromPort"/> 069 * <property value="East_0" name="toPort"/> 070 * </pageflow-object> 071 * <pageflow-object id="action-call:@page:index.jsp@#@action:doValidator.do@"> 072 * <property value="420,420,420,420" name="elbowsX"/> 073 * <property value="256,250,250,244" name="elbowsY"/> 074 * <property value="North_1" name="fromPort"/> 075 * <property value="South_1" name="toPort"/> 076 * </pageflow-object> 077 * <pageflow-object id="action-call:@page:index.jsp@#@action:doBasic.do@"> 078 * <property value="420,420,420,420" name="elbowsX"/> 079 * <property value="344,350,350,356" name="elbowsY"/> 080 * <property value="South_1" name="fromPort"/> 081 * <property value="North_1" name="toPort"/> 082 * </pageflow-object> 083 * <pageflow-object id="action:done.do"> 084 * <property value="600" name="x"/> 085 * <property value="300" name="y"/> 086 * </pageflow-object> 087 * <pageflow-object id="action-call:@page:index.jsp@#@action:done.do@"> 088 * <property value="456,510,510,564" name="elbowsX"/> 089 * <property value="292,292,292,292" name="elbowsY"/> 090 * <property value="East_1" name="fromPort"/> 091 * <property value="West_1" name="toPort"/> 092 * </pageflow-object> 093 * <pageflow-object id="forward:path#done#/Controller.jpf#@action:done.do@"> 094 * <property value="600,600,600,600" name="elbowsX"/> 095 * <property value="344,350,350,356" name="elbowsY"/> 096 * <property value="South_1" name="fromPort"/> 097 * <property value="North_1" name="toPort"/> 098 * <property value="done" name="label"/> 099 * </pageflow-object> 100 * <pageflow-object id="external-jpf:/Controller.jpf"> 101 * <property value="600" name="x"/> 102 * <property value="400" name="y"/> 103 * </pageflow-object> 104 * </view-properties> 105 * :: 106 * 107 */ 108 public class Controller extends PageFlowController 109 { 110 /** 111 * @jpf:action 112 * @jpf:forward name="index" path="index.jsp" 113 */ 114 public Forward begin() 115 { 116 return new Forward( "index" ); 117 } 118 119 /** 120 * @jpf:action 121 * @jpf:forward name="basicValidationPageFlow" path="basic/Controller.jpf" 122 */ 123 public Forward doBasic() 124 { 125 return new Forward( "basicValidationPageFlow" ); 126 } 127 128 /** 129 * @jpf:action 130 * @jpf:forward name="validatorPageFlow" path="validator/Controller.jpf" 131 */ 132 public Forward doValidator() 133 { 134 return new Forward( "validatorPageFlow" ); 135 } 136 137 /** 138 * This method represents an exit out of this pageflow 139 * @jpf:action 140 * @jpf:forward name="done" path="/Controller.jpf" 141 */ 142 public Forward done() 143 { 144 return new Forward( "done" ); 145 } 146 147 }`