# FormBasedLoginFlowController.jpf Sample

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

## Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/security/formBasedLogin/formBasedLoginFlow/

## Sample Source Code

`01 // ------------------------------------------------------------------------------ 02 // Generated by WebLogic Workshop 03 // 04 // Created on: Thu Aug 28 10:21:05 PDT 2003 05 // By: steveh 06 // ----------------------------------------------------------------------------- 07 package security.formBasedLogin.formBasedLoginFlow; 08 import com.bea.wlw.netui.pageflow.Forward; 09 import com.bea.wlw.netui.pageflow.PageFlowController; 10 11 /** 12 * This page flow file has been declared a protected web resource in the deployment 13 * descriptor WEB-INF/web.xml. 14 * This page flow is protected both by a (1) login requirement and (2) a role-membership 15 * reaquirement, both of which are specified by the <security-constraint> element in 16 * WEB-INF/web.xml. 17 * 18 * @jpf:controller 19 * @jpf:view-properties view-properties:: 20 * <!-- This data is auto-generated. Hand-editing this section is not recommended. --> 21 * <view-properties> 22 * <pageflow-object id="pageflow:/security/login/formBasedLogin/formBasedLoginFlow/formBasedLoginFlowController.jpf"/> 23 * <pageflow-object id="action:begin.do"> 24 * <property value="80" name="x"/> 25 * <property value="100" name="y"/> 26 * </pageflow-object> 27 * <pageflow-object id="action:doLogoutSamplesHome.do"> 28 * <property value="360" name="x"/> 29 * <property value="100" name="y"/> 30 * </pageflow-object> 31 * <pageflow-object id="action-call:@page:index.jsp@#@action:doLogoutSamplesHome.do@"> 32 * <property value="276,300,300,324" name="elbowsX"/> 33 * <property value="92,92,92,92" name="elbowsY"/> 34 * <property value="East_1" name="fromPort"/> 35 * <property value="West_1" name="toPort"/> 36 * </pageflow-object> 37 * <pageflow-object id="page:index.jsp"> 38 * <property value="240" name="x"/> 39 * <property value="100" name="y"/> 40 * </pageflow-object> 41 * <pageflow-object id="external-jpf:/security/securityController.jpf"> 42 * <property value="500" name="x"/> 43 * <property value="100" name="y"/> 44 * </pageflow-object> 45 * <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@"> 46 * <property value="116,160,160,204" name="elbowsX"/> 47 * <property value="92,92,92,92" name="elbowsY"/> 48 * <property value="East_1" name="fromPort"/> 49 * <property value="West_1" name="toPort"/> 50 * <property value="success" name="label"/> 51 * </pageflow-object> 52 * <pageflow-object id="forward:path#success#/security/securityController.jpf#@action:doLogoutSamplesHome.do@"> 53 * <property value="396,430,430,464" name="elbowsX"/> 54 * <property value="92,92,92,92" name="elbowsY"/> 55 * <property value="East_1" name="fromPort"/> 56 * <property value="West_1" name="toPort"/> 57 * <property value="success" name="label"/> 58 * </pageflow-object> 59 * </view-properties> 60 * :: 61 */ 62 public class formBasedLoginFlowController extends PageFlowController 63 { 64 /** 65 * @jpf:action 66 * @jpf:forward name="success" path="index.jsp" 67 */ 68 protected Forward begin() 69 { 70 return new Forward( "success" ); 71 } 72 73 /** 74 * @jpf:action 75 * @jpf:forward name="success" path="/security/securityController.jpf" 76 */ 77 protected Forward doLogoutSamplesHome() 78 { 79 logout( false ); 80 return new Forward("success"); 81 } 82 }`