# ImageAnchorController.jpf Sample

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

## Sample Source Code

`001 package tagSamples.netui.imageAnchor; 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 import java.util.Date; 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:/tagSamples/netui/imageAnchor/ImageAnchorController.jpf"/> 013 * <pageflow-object id="action:begin.do"> 014 * <property value="80" name="x"/> 015 * <property value="240" name="y"/> 016 * </pageflow-object> 017 * <pageflow-object id="action:formSubmit.do#tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm"> 018 * <property value="240" name="x"/> 019 * <property value="120" name="y"/> 020 * </pageflow-object> 021 * <pageflow-object id="action:showCurrentTime.do"> 022 * <property value="360" name="x"/> 023 * <property value="240" name="y"/> 024 * </pageflow-object> 025 * <pageflow-object id="action-call:@page:index.jsp@#@action:formSubmit.do#tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm@"> 026 * <property value="240,240,240,240" name="elbowsX"/> 027 * <property value="196,180,180,164" name="elbowsY"/> 028 * <property value="North_1" name="fromPort"/> 029 * <property value="South_1" name="toPort"/> 030 * </pageflow-object> 031 * <pageflow-object id="action-call:@page:index.jsp@#@action:showCurrentTime.do@"> 032 * <property value="276,300,300,324" name="elbowsX"/> 033 * <property value="232,232,232,232" name="elbowsY"/> 034 * <property value="East_1" name="fromPort"/> 035 * <property value="West_1" name="toPort"/> 036 * </pageflow-object> 037 * <pageflow-object id="page:index.jsp"> 038 * <property value="240" name="x"/> 039 * <property value="240" name="y"/> 040 * </pageflow-object> 041 * <pageflow-object id="page:showData.jsp"> 042 * <property value="400" name="x"/> 043 * <property value="120" name="y"/> 044 * </pageflow-object> 045 * <pageflow-object id="page:showCurrentTime.jsp"> 046 * <property value="520" name="x"/> 047 * <property value="240" name="y"/> 048 * </pageflow-object> 049 * <pageflow-object id="page:linkPage.jsp"> 050 * <property value="240" name="x"/> 051 * <property value="40" name="y"/> 052 * </pageflow-object> 053 * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@"> 054 * <property value="116,160,160,204" name="elbowsX"/> 055 * <property value="232,232,232,232" name="elbowsY"/> 056 * <property value="East_1" name="fromPort"/> 057 * <property value="West_1" name="toPort"/> 058 * <property value="success" name="label"/> 059 * </pageflow-object> 060 * <pageflow-object id="forward:path#success#showData.jsp#@action:formSubmit.do#tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm@"> 061 * <property value="276,320,320,364" name="elbowsX"/> 062 * <property value="112,112,112,112" name="elbowsY"/> 063 * <property value="East_1" name="fromPort"/> 064 * <property value="West_1" name="toPort"/> 065 * <property value="success" name="label"/> 066 * </pageflow-object> 067 * <pageflow-object id="forward:path#success#showCurrentTime.jsp#@action:showCurrentTime.do@"> 068 * <property value="396,440,440,484" name="elbowsX"/> 069 * <property value="232,232,232,232" name="elbowsY"/> 070 * <property value="East_1" name="fromPort"/> 071 * <property value="West_1" name="toPort"/> 072 * <property value="success" name="label"/> 073 * </pageflow-object> 074 * <pageflow-object id="formbeanprop:tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm#firstname#java.lang.String"/> 075 * <pageflow-object id="formbeanprop:tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm#lastname#java.lang.String"/> 076 * <pageflow-object id="formbean:tagSamples.netui.imageAnchor.ImageAnchorController.FormSubmitForm"/> 077 * </view-properties> 078 * :: 079 */ 080 public class ImageAnchorController extends PageFlowController 081 { 082 /** 083 * @jpf:action 084 * @jpf:forward name="success" path="index.jsp" 085 */ 086 protected Forward begin() 087 { 088 return new Forward("success"); 089 } 090 091 /** 092 * @jpf:action 093 * @jpf:forward name="success" path="showData.jsp" 094 */ 095 protected Forward formSubmit(FormSubmitForm form) 096 { 097 getRequest().setAttribute("submittedData", form); 098 return new Forward("success"); 099 } 100 101 /** 102 * @jpf:action 103 * @jpf:forward name="success" path="showCurrentTime.jsp" 104 */ 105 protected Forward showCurrentTime() 106 { 107 Date date = new java.util.Date(); 108 System.out.println(date); 109 getRequest().setAttribute("date", date); 110 return new Forward("success"); 111 } 112 113 public static class FormSubmitForm extends FormData 114 { 115 private String lastname; 116 117 private String firstname; 118 119 public void setFirstname(String firstname) 120 { 121 this.firstname = firstname; 122 } 123 124 public String getFirstname() 125 { 126 return this.firstname; 127 } 128 129 public void setLastname(String lastname) 130 { 131 this.lastname = lastname; 132 } 133 134 public String getLastname() 135 { 136 return this.lastname; 137 } 138 } 139 }`