# TextBoxController.jpf Sample

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

## Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui/textBox/

## Sample Source Code

`01 package tagSamples.netui.textBox; 02 import com.bea.wlw.netui.pageflow.FormData; 03 import com.bea.wlw.netui.pageflow.Forward; 04 import com.bea.wlw.netui.pageflow.PageFlowController; 05 06 /** 07 * @jpf:controller 08 * @jpf:view-properties view-properties:: 09 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 10 * <view-properties> 11 * <pageflow-object id="pageflow:/tagSamples/netui/textBox/TextBoxController.jpf"/> 12 * <pageflow-object id="action:begin.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm"> 13 * <property value="80" name="x"/> 14 * <property value="100" name="y"/> 15 * </pageflow-object> 16 * <pageflow-object id="action:processText.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm"> 17 * <property value="240" name="x"/> 18 * <property value="280" name="y"/> 19 * </pageflow-object> 20 * <pageflow-object id="action-call:@page:index.jsp@#@action:processText.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm@"> 21 * <property value="240,240,240,240" name="elbowsX"/> 22 * <property value="144,190,190,236" name="elbowsY"/> 23 * <property value="South_1" name="fromPort"/> 24 * <property value="North_1" name="toPort"/> 25 * </pageflow-object> 26 * <pageflow-object id="page:index.jsp"> 27 * <property value="240" name="x"/> 28 * <property value="100" name="y"/> 29 * </pageflow-object> 30 * <pageflow-object id="page:showText.jsp"> 31 * <property value="80" name="x"/> 32 * <property value="280" name="y"/> 33 * </pageflow-object> 34 * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm@"> 35 * <property value="116,160,160,204" name="elbowsX"/> 36 * <property value="92,92,92,92" name="elbowsY"/> 37 * <property value="East_1" name="fromPort"/> 38 * <property value="West_1" name="toPort"/> 39 * <property value="success" name="label"/> 40 * </pageflow-object> 41 * <pageflow-object id="forward:path#success#showText.jsp#@action:processText.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm@"> 42 * <property value="204,160,160,116" name="elbowsX"/> 43 * <property value="272,272,272,272" name="elbowsY"/> 44 * <property value="West_1" name="fromPort"/> 45 * <property value="East_1" name="toPort"/> 46 * <property value="success" name="label"/> 47 * </pageflow-object> 48 * <pageflow-object id="formbeanprop:tagSamples.netui.textBox.TextBoxController.ProcessTextForm#text#java.lang.String"/> 49 * <pageflow-object id="formbean:tagSamples.netui.textBox.TextBoxController.ProcessTextForm"/> 50 * <pageflow-object id="action-call:@page:showText.jsp@#@action:begin.do#tagSamples.netui.textBox.TextBoxController.ProcessTextForm@"> 51 * <property value="80,80,80,80" name="elbowsX"/> 52 * <property value="236,190,190,144" name="elbowsY"/> 53 * <property value="North_1" name="fromPort"/> 54 * <property value="South_1" name="toPort"/> 55 * </pageflow-object> 56 * </view-properties> 57 * :: 58 */ 59 public class TextBoxController extends PageFlowController 60 { 61 /** 62 * @jpf:action 63 * @jpf:forward name="success" path="index.jsp" 64 */ 65 protected Forward begin(ProcessTextForm form) 66 { 67 form.setText("default text"); 68 return new Forward("success", form); 69 } 70 71 /** 72 * @jpf:action 73 * @jpf:forward name="success" path="showText.jsp" 74 */ 75 protected Forward processText(ProcessTextForm form) 76 { 77 // Convert the text to uppercase, and store it in the Request object. 78 getRequest().setAttribute("text", form.text.toUpperCase()); 79 return new Forward("success"); 80 } 81 82 /** 83 * FormData get and set methods may be overwritten by the Form Bean editor. 84 */ 85 public static class ProcessTextForm extends FormData 86 { 87 private String text; 88 89 public void setText(String text) 90 { 91 this.text = text; 92 } 93 94 public String getText() 95 { 96 return this.text; 97 } 98 } 99 }`