# NestedPageFlowController.jpf Sample

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

## Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/navigation/nesting/nestedPageFlow/

## Sample Source Code

`001 package navigation.nesting.nestedPageFlow; 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 * This nested Page Flow collects data from the user and passes it to its nesting Page Flow. 008 * 009 * Note: if you try to run this Page Flow independently of its nesting Page Flow, 010 * a EmptyNestingStackException exception will be thrown when you submit the 011 * profile data. 012 * 013 * @jpf:controller nested="true" 014 * @jpf:view-properties view-properties:: 015 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 016 * <view-properties> 017 * <pageflow-object id="pageflow:/navigation/nesting/nestedPageFlow/NestedPageFlowController.jpf"/> 018 * <pageflow-object id="action:begin.do"> 019 * <property value="80" name="x"/> 020 * <property value="100" name="y"/> 021 * </pageflow-object> 022 * <pageflow-object id="action:submitProfile.do#navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm"> 023 * <property value="380" name="x"/> 024 * <property value="100" name="y"/> 025 * </pageflow-object> 026 * <pageflow-object id="action:toNestedPageFlow.do"> 027 * <property value="520" name="x"/> 028 * <property value="200" name="y"/> 029 * </pageflow-object> 030 * <pageflow-object id="action-call:@page:index.jsp@#@action:submitProfile.do#navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm@"> 031 * <property value="276,310,310,344" name="elbowsX"/> 032 * <property value="92,92,92,92" name="elbowsY"/> 033 * <property value="East_1" name="fromPort"/> 034 * <property value="West_1" name="toPort"/> 035 * </pageflow-object> 036 * <pageflow-object id="page:index.jsp"> 037 * <property value="240" name="x"/> 038 * <property value="100" name="y"/> 039 * </pageflow-object> 040 * <pageflow-object id="external-jpf:/navigation/nesting/nestingPageFlow/NestingPageFlowController.jpf"> 041 * <property value="680" name="x"/> 042 * <property value="200" name="y"/> 043 * </pageflow-object> 044 * <pageflow-object id="action-call:@page:error.jsp@#@action:toNestedPageFlow.do@"> 045 * <property value="416,450,450,484" name="elbowsX"/> 046 * <property value="192,192,192,192" name="elbowsY"/> 047 * <property value="East_1" name="fromPort"/> 048 * <property value="West_1" name="toPort"/> 049 * </pageflow-object> 050 * <pageflow-object id="page:error.jsp"> 051 * <property value="380" name="x"/> 052 * <property value="200" name="y"/> 053 * </pageflow-object> 054 * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@"> 055 * <property value="116,160,160,204" name="elbowsX"/> 056 * <property value="92,92,92,92" name="elbowsY"/> 057 * <property value="East_1" name="fromPort"/> 058 * <property value="West_1" name="toPort"/> 059 * <property value="success" name="label"/> 060 * </pageflow-object> 061 * <pageflow-object id="exit:showProfile"> 062 * <property value="520" name="x"/> 063 * <property value="100" name="y"/> 064 * </pageflow-object> 065 * <pageflow-object id="forward:return-action#success#showProfile#@action:submitProfile.do#navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm@"> 066 * <property value="416,450,450,484" name="elbowsX"/> 067 * <property value="92,92,92,92" name="elbowsY"/> 068 * <property value="East_1" name="fromPort"/> 069 * <property value="West_1" name="toPort"/> 070 * <property value="success" name="label"/> 071 * </pageflow-object> 072 * <pageflow-object id="forward:path#success#/navigation/nesting/nestingPageFlow/NestingPageFlowController.jpf#@action:toNestedPageFlow.do@"> 073 * <property value="556,600,600,644" name="elbowsX"/> 074 * <property value="192,192,192,192" name="elbowsY"/> 075 * <property value="East_1" name="fromPort"/> 076 * <property value="West_1" name="toPort"/> 077 * <property value="success" name="label"/> 078 * </pageflow-object> 079 * <pageflow-object id="formbeanprop:navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm#firstName#java.lang.String"/> 080 * <pageflow-object id="formbeanprop:navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm#lastName#java.lang.String"/> 081 * <pageflow-object id="formbeanprop:navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm#age#int"/> 082 * <pageflow-object id="formbean:navigation.nesting.nestedPageFlow.NestedPageFlowController.ProfileForm"/> 083 * </view-properties> 084 * :: 085 * @jpf:catch path="error.jsp" type="com.bea.wlw.netui.pageflow.EmptyNestingStackException" 086 */ 087 public class NestedPageFlowController extends PageFlowController 088 { 089 /** 090 * @jpf:action 091 * @jpf:forward name="success" path="index.jsp" 092 */ 093 protected Forward begin() 094 { 095 return new Forward("success"); 096 } 097 098 /** 099 * The "showProfile" action is a method on the nesting Page Flow. 100 * The profile data collected from the customer is returned to 101 * the "showProfile" action. 102 * 103 * @jpf:action 104 * @jpf:forward return-action="showProfile" return-form-type="ProfileForm" name="success" 105 */ 106 protected Forward submitProfile(ProfileForm form) 107 { 108 return new Forward("success", form); 109 } 110 111 /** 112 * @jpf:action 113 * @jpf:forward name="success" path="/navigation/nesting/nestingPageFlow/NestingPageFlowController.jpf" 114 */ 115 protected Forward toNestedPageFlow() 116 { 117 return new Forward("success"); 118 } 119 120 public static class ProfileForm extends FormData 121 { 122 private int age; 123 124 private String lastName; 125 126 private String firstName; 127 128 public void setFirstName(String firstName) 129 { 130 this.firstName = firstName; 131 } 132 133 public String getFirstName() 134 { 135 return this.firstName; 136 } 137 138 public void setLastName(String lastName) 139 { 140 this.lastName = lastName; 141 } 142 143 public String getLastName() 144 { 145 return this.lastName; 146 } 147 148 public void setAge(int age) 149 { 150 this.age = age; 151 } 152 153 public int getAge() 154 { 155 return this.age; 156 } 157 } 158 }`