# StrutsMergeController.jpf Sample

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

## Sample Source Code

`001 // ------------------------------------------------------------------------------ 002 // Generated by WebLogic Workshop 003 // 004 // Created on: Tue May 27 09:47:59 PDT 2003 005 // By: smart 006 // ----------------------------------------------------------------------------- 007 package struts.strutsMerge; 008 import com.bea.wlw.netui.pageflow.Forward; 009 import com.bea.wlw.netui.pageflow.PageFlowController; 010 import com.bea.wlw.netui.pageflow.FormData; 011 012 /** 013 * @jpf:controller struts-merge="/WEB-INF/all-struts-config-merge-example.xml" 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:/struts/strutsMerge/strutsMergeController.jpf"/> 018 * <pageflow-object id="action:begin.do"> 019 * <property value="40" name="x"/> 020 * <property value="60" name="y"/> 021 * </pageflow-object> 022 * <pageflow-object id="action:unk.do"> 023 * <property value="360" name="x"/> 024 * <property value="200" name="y"/> 025 * </pageflow-object> 026 * <pageflow-object id="action:formAction.do#struts.strutsMerge.strutsMergeController.Form"> 027 * <property value="240" name="x"/> 028 * <property value="260" name="y"/> 029 * </pageflow-object> 030 * <pageflow-object id="page:page1.jsp"> 031 * <property value="240" name="x"/> 032 * <property value="60" name="y"/> 033 * </pageflow-object> 034 * <pageflow-object id="action-call:@page:page2.jsp@#@action:begin.do@"> 035 * <property value="40,40,40,40" name="elbowsX"/> 036 * <property value="216,160,160,104" name="elbowsY"/> 037 * <property value="North_1" name="fromPort"/> 038 * <property value="South_1" name="toPort"/> 039 * </pageflow-object> 040 * <pageflow-object id="page:page2.jsp"> 041 * <property value="40" name="x"/> 042 * <property value="260" name="y"/> 043 * </pageflow-object> 044 * <pageflow-object id="forward:path#page1#page1.jsp#@action:formAction.do#struts.strutsMerge.strutsMergeController.Form@"> 045 * <property value="240,240,240,240" name="elbowsX"/> 046 * <property value="216,160,160,104" name="elbowsY"/> 047 * <property value="North_1" name="fromPort"/> 048 * <property value="South_1" name="toPort"/> 049 * <property value="page1" name="label"/> 050 * </pageflow-object> 051 * <pageflow-object id="formbean:struts.strutsMerge.strutsMergeController.Form"/> 052 * <pageflow-object id="forward:path#page1#page1.jsp#@action:begin.do@"> 053 * <property value="76,140,140,204" name="elbowsX"/> 054 * <property value="52,52,52,52" name="elbowsY"/> 055 * <property value="East_1" name="fromPort"/> 056 * <property value="West_1" name="toPort"/> 057 * <property value="page1" name="label"/> 058 * </pageflow-object> 059 * </view-properties> 060 * :: 061 */ 062 public class strutsMergeController extends PageFlowController 063 { 064 /** 065 * @jpf:action 066 * @jpf:forward name="page1" path="page1.jsp" 067 */ 068 protected Forward begin() 069 { 070 return new Forward( "page1" ); 071 } 072 073 /** 074 * This action method gets run after we successfully merge the struts config 075 * file, which marks this action as the "unknown" handler. It forwards 076 * to a global forward ("fromStrutsConfig") that is in the merged file. 077 * 078 * @jpf:action 079 */ 080 public Forward unk() 081 { 082 return new Forward( "fromStrutsConfig" ); 083 } 084 085 /** 086 * This action's form-scope will be changed to "session". 087 * 088 * @jpf:action 089 * @jpf:forward name="page1" path="page1.jsp" 090 */ 091 public Forward formAction( Form form ) 092 { 093 return new Forward( "page1" ); 094 } 095 096 097 public static class Form extends FormData 098 { 099 } 100 101 102 103 104 105 }`