svn commit: rev 36377 - in incubator/beehive/trunk/netui: src/compiler/org/apache/beehive/netui/compiler src/compiler/org/apache/beehive/netui/compiler/genmodel src/compiler/org/apache/beehive/netui/compiler/grammar src/compiler/org/apache/beehive/netui/compiler/model src/pageflow/org/apache/beehive/netui/pageflow src/pageflow/org/apache/beehive/netui/pageflow/annotations src/pageflow/org/apache/beehive/netui/pageflow/config src/pageflow/org/apache/beehive/netui/pageflow/internal src/pageflow/org/apache/beehive/netui/pageflow/util src/pageflow/org/apache/beehive/netui/script/common src/scoping/org/apache/beehive/netui/pageflow/scoping src/tags-html/org/apache/beehive/netui/tags/html test/webapps/drt/coreWeb test/webapps/drt/coreWeb/WEB-INF test/webapps/drt/coreWeb/WEB-INF/src/global test/webapps/drt/coreWeb/databinding/cellrepeatererror test/webapps/drt/coreWeb/databinding/globalApp/nojpf test/webapps/drt/coreWeb/interOp/test2/Controller1 test/webapps/drt/coreWeb/miniTests/appState test/webapps/drt/coreWeb/miniTests/appStatePass test/webapps/drt/coreWeb/miniTests/appStatePass/nested test/webapps/drt/coreWeb/miniTests/lifecycle test/webapps/drt/coreWeb/miscJpf/bug30448 test/webapps/drt/coreWeb/pageFlowCore/pfGlobalApp test/webapps/drt/coreWeb/pageFlowCore/sharedFlow test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1 test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1 test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2 test/webapps/drt/coreWeb/results test/webapps/drt/coreWeb/strutsMerge/test2 test/webapps/drt/coreWeb/strutsMerge/test3 test/webapps/drt/coreWeb/strutsMerge/test4 test/webapps/drt/testRecorder/config test/webapps/drt/testRecorder/tests

14 Aug 2004 06:06:22 -0000

Author: rich
Date: Fri Aug 13 23:06:05 2004
New Revision: 36377

Added:
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
   (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/SharedFlow.jpfs   
(contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/mockportal.tld   
(contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/HasNoSharedFlow.jpf
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/SharedFlow1.jpfs
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/index.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/SharedFlow2.jpfs
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/index.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/index.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/index.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfSharedFlow.xml
Removed:
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/global/Global.app
Modified:
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowGenerator.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowGenerator.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowJspFilter.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/CachedPageFlowInfo.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
   
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
   
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/cellrepeatererror/index.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/globalApp/nojpf/index.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/interOp/test2/Controller1/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Begin.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Begin.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/nested/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Begin.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug30448/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfGlobalApp/Controller.jpf
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/results/Begin.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test2/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test3/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test4/Jpf1.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppState.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppStatePass.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CellRepeaterError2.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/Lifecycle.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfGlobalApp.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/StrutsInteropTest2.xml
Log:
Preliminary Shared Flow support.  This feature has the following 
characteristics:
    
    - Every page flow has either zero or one shared flows.

    - A page flow's shared flow is the nearest SharedFlowController-derived 
(and @Jpf.Controller-annotated) class in or above the page flow's package.  So, 
if the following classes exist:
            foo.bar.baz.PageFlow1
          * foo.bar.baz.SharedFlow1
            foo.bar.PageFlow2
            foo.PageFlow3
          * foo.SharedFlow2
      PageFlow1 sees SharedFlow1, and both PageFlow2 and PageFlow3 see 
SharedFlow2.

    - Shared flow source files can exist in the webapp as ".jpfs" files, and 
they can also exist as normal Java source files.  Unlike page flows, they are 
not web-addressable.

    - When a page flow is hit, its associated shared flow is created and stored 
in the session.

    - When an action is raised on a page flow, and the page flow does not 
handle it (with a @Jpf.Action), the action bubbles up to the shared flow.  The 
current page flow remains the same, unless the shared flow action forwards to 
another page flow.

    - When an exception occurs in a page flow action, and the page flow does 
not handle it (with a @Jpf.Catch), the exception bubbles up to the shared flow. 
 The current page flow remains the same, unless the shared flow action forwards 
to another page flow.

    - If a page flow contains a member field annotated with 
@Jpf.SharedFlowField, that field will be initialized with the associated shared 
flow instance.  This is useful for directly accessing shared flow state and 
functionality from a page flow.

    - Shared flows can be deleted explicitly through methods on PageFlowUtils.

    - (TBD) JSP tags can bind to the shared flow using the "sharedFlow" binding 
context.

Philosophical question: Why not just depend on inheritance for these features?  
The main reason is that most often the state for a shared flow needs to be... 
shared, rather than duplicated across all page flows extending a common base 
class.  Shared flows have their own lifecycles, and can be managed 
independently of the page flows that depend on them.  Shared flows also avoid 
stealing the single spot in the inheritance hierarchy, so that various page 
flows under a single shared flow can extend the right base classes to provide 
inherited behavior and state.  Finally, avoiding inheritance also prevents 
confusing/inappropriate behavior surrounding forwards to relative paths from 
actions in the base class.

See netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/* for examples.

DRT: netui
buddy build: self



Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/CompilerUtils.java
     Fri Aug 13 23:06:05 2004
@@ -713,6 +713,7 @@
             if ( ! retVal.exists() ) retVal = null;
         }
 
+        if ( retVal.exists() ) retVal = retVal.getAbsoluteFile();
         return retVal;
     }
     
@@ -864,5 +865,24 @@
     public static boolean isPageFlowClass( ClassDeclaration jclass, 
AnnotationProcessorEnvironment env )
     {
         return getAnnotation( jclass, CONTROLLER_TAG_NAME ) != null && 
isAssignableFrom( JPF_BASE_CLASS, jclass, env );
+    }
+
+    public static String removeFileExtension( String uri )
+    {
+        int lastDot = uri.lastIndexOf( '.' );
+        return uri.substring( 0, lastDot );
+    }
+    
+    public static TypeDeclaration inferTypeFromFile( File file, String 
webappRoot, AnnotationProcessorEnvironment env )
+    {
+        assert file.getPath().startsWith( webappRoot ) : file + ", " + 
webappRoot;
+        return inferTypeFromPath( file.getPath().substring( 
webappRoot.length() ).replace( File.separatorChar, '/'), env );
+    }
+    
+    public static TypeDeclaration inferTypeFromPath( String 
pathFromWebappRoot, AnnotationProcessorEnvironment env )
+    {
+        assert pathFromWebappRoot.startsWith( "/" ) : pathFromWebappRoot;
+        String className =  removeFileExtension( pathFromWebappRoot.substring( 
1 ) );
+        return env.getTypeDeclaration( className.replace( '/', '.' ) );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerChecker.java
     Fri Aug 13 23:06:05 2004
@@ -150,7 +150,7 @@
         // checkActionMethodForwards( ( ILangNode ) first.getNode() );        
     }
     
-    protected abstract GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage )
+    protected abstract GenStrutsApp createStrutsApp( File sourceFile, 
ClassDeclaration jclass )
         throws XmlException, IOException, NoWebInfDirectoryException;
     
     protected void startCheckClass( ClassDeclaration jclass )
@@ -170,7 +170,7 @@
             //
             try
             {
-                strutsApp = createStrutsApp( sourceFile, 
jclass.getPackage().getQualifiedName() );
+                strutsApp = createStrutsApp( sourceFile, jclass );
                 strutsConfigFile = strutsApp.getStrutsConfigFile();
             }
             catch ( XmlException e )

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
   Fri Aug 13 23:06:05 2004
@@ -28,7 +28,6 @@
 import org.apache.xmlbeans.XmlException;
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import com.sun.mirror.declaration.ClassDeclaration;
-import com.sun.mirror.declaration.PackageDeclaration;
 
 
 abstract class FlowControllerGenerator
@@ -37,26 +36,26 @@
     private static long _compilerJarTimestamp = -1;
     private static final boolean ALWAYS_GENERATE = 
             System.getProperty( "pageflow.always-generate-struts-config" ) != 
null;
+    private FlowControllerInfo _fcInfo;
     
     
     
-    public FlowControllerGenerator( AnnotationProcessorEnvironment env )
+    protected FlowControllerGenerator( AnnotationProcessorEnvironment env, 
FlowControllerInfo fcInfo )
     {
         super( env );
+        _fcInfo = fcInfo;
     }
     
-    protected abstract GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage, ClassDeclaration cl )
+    protected abstract GenStrutsApp createStrutsApp( File sourceFile, 
ClassDeclaration cl )
             throws XmlException, IOException, NoWebInfDirectoryException;
     
     public void generate( ClassDeclaration publicClass )
     {
-        PackageDeclaration pkg = publicClass.getPackage();
-        String pkgName = pkg != null ? pkg.getQualifiedName() : null;
         GenStrutsApp app = null;
         
         try
         {
-            app = createStrutsApp( CompilerUtils.getOriginalFile( publicClass 
), pkgName, publicClass );
+            app = createStrutsApp( CompilerUtils.getOriginalFile( publicClass 
), publicClass );
             GenValidationModel validationModel = new GenValidationModel( 
publicClass, app );
             
             if ( ! validationModel.isEmpty() )
@@ -114,5 +113,10 @@
                                        strutsConfigFile != null ? new 
Object[]{ strutsConfigFile.getPath() } : null,
                                        null );
         }
+    }
+
+    protected FlowControllerInfo getFlowControllerInfo()
+    {
+        return _fcInfo;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FlowControllerInfo.java
        Fri Aug 13 23:06:05 2004
@@ -24,6 +24,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.io.File;
 
 import static 
org.apache.beehive.netui.compiler.JpfLanguageConstants.GLOBALAPP_FULL_CLASSNAME;
@@ -38,8 +39,9 @@
     private boolean _nested = false;
     private Set _returnActions = null;
     private File _webappRoot = null;
-    private TypeDeclaration _sharedFlowType = null;
-    private File _sharedFlowFile = null;
+    private List< TypeDeclaration > _sharedFlowTypeHierarchy;
+    private List< String > _sharedFlowTypeNameHierarchy;
+    private List< File > _sharedFlowFileHierarchy;
     private List< File > _referencedPageFlows = new ArrayList< File >();
     private File _sourceFile;
     private boolean _isBuilding = false;
@@ -120,7 +122,7 @@
     void endBuild()
     {
         _isBuilding = false;
-        _sharedFlowType = null;     // don't hang onto the ClassDeclaration
+        _sharedFlowTypeHierarchy = null;     // don't hang onto the 
ClassDeclaration
     }
     
     public ActionInfo[] getActions()
@@ -220,42 +222,35 @@
     
     public File getSharedFlowFile()
     {
-        return _sharedFlowFile;
+        return _sharedFlowFileHierarchy != null && 
_sharedFlowFileHierarchy.size() > 0 ? _sharedFlowFileHierarchy.get( 0 ) : null;
     }
 
-    void setSharedFlowType( TypeDeclaration sharedFlowType )
+    void setSharedFlowInfo( List< TypeDeclaration > typeHierarchy, List< File 
> fileHierarchy )
     {
-        _sharedFlowType = sharedFlowType;
-
-        if ( sharedFlowType != null )
+        _sharedFlowTypeHierarchy = typeHierarchy;
+        _sharedFlowFileHierarchy = fileHierarchy;
+        
+        if ( fileHierarchy != null )
         {
-            _sharedFlowFile = CompilerUtils.getOriginalFile( _sharedFlowType );
-
-            if ( _sharedFlowFile == null )
+            _sharedFlowTypeNameHierarchy = new ArrayList< String >();
+            
+            for ( Iterator<TypeDeclaration> i = typeHierarchy.iterator(); 
i.hasNext(); )
             {
-                if ( _sharedFlowType.getQualifiedName().equals( 
GLOBALAPP_FULL_CLASSNAME ) )
-                {
-                    StringBuilder sb = new StringBuilder( 
getWebappRoot().getPath() );
-                    sb.append( WEBINF_SRC_DIR ).append( '/' );
-                    sb.append( GLOBALAPP_PACKAGE ).append( '/' );
-                    sb.append( GLOBALAPP_CLASSNAME ).append( 
GLOBALAPP_FILE_EXTENSION_DOT );
-                    _sharedFlowFile = new File( sb.toString() );
-                }
-                else
-                {
-                    String fileRelativePath = 
_sharedFlowType.getQualifiedName().replace( '.', '/' ) + ".java";
-                    _sharedFlowFile = CompilerUtils.findSourceFileInWebapp( 
getWebappRoot().getPath(), fileRelativePath );
-                }
+                TypeDeclaration sfType = i.next();
+                _sharedFlowTypeNameHierarchy.add( sfType != null ? 
sfType.getQualifiedName() : null );
             }
-
-            assert _sharedFlowFile != null : "could not get shared flow file 
for " + sharedFlowType;
         }
     }
+    
+    public List<TypeDeclaration> getSharedFlowTypeHierarchy()
+    {
+        assert _isBuilding : "use getSharedFlowTypeNameHierarchy after check 
phase";
+        return _sharedFlowTypeHierarchy;
+    }
 
-    public TypeDeclaration getSharedFlowType()
+    public List< String > getSharedFlowTypeNameHierarchy()
     {
-        assert _isBuilding;
-        return _sharedFlowType;
+        return _sharedFlowTypeNameHierarchy;
     }
 
     public File getWebappRoot()

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
      (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
      Fri Aug 13 23:06:05 2004
@@ -69,17 +69,19 @@
     public static final String GLOBALAPP_FILE_EXTENSION = "app";
     public static final String GLOBALAPP_FILE_EXTENSION_DOT = "." + 
GLOBALAPP_FILE_EXTENSION;
     public static final String SHARED_FLOW_FILE_EXTENSION_DOT = "." + 
SHARED_FLOW_FILE_EXTENSION;
-    public static final String SHARED_FLOW_CLASSNAME = "SharedFlow";
+    public static final String SHARED_FLOW_CLASSNAME = "SharedFlowController";
     public static final String FLOWCONTROLLER_BASE_CLASS = PAGEFLOW_PACKAGE + 
".FlowController";
     public static final String JPF_BASE_CLASS = PAGEFLOW_PACKAGE + 
".PageFlowController";
-    public static final String SHARED_FLOW_BASE_CLASS = PAGEFLOW_PACKAGE + 
".SharedFlow";
+    public static final String SHARED_FLOW_BASE_CLASS = PAGEFLOW_PACKAGE + 
".SharedFlowController";
+    public static final String WEBAPP_ROOT_PACKAGE = "webappRoot";
     public static final String GLOBALAPP_BASE_CLASS = PAGEFLOW_PACKAGE + 
".GlobalApp";
     public static final String GLOBALAPP_PACKAGE = "global";
-    public static final String SHARED_FLOW_FILENAME = "SharedFlow.jpfs";
     public static final String GLOBALAPP_CLASSNAME = "Global";
     public static final String GLOBALAPP_FULL_CLASSNAME = GLOBALAPP_PACKAGE + 
"." + GLOBALAPP_CLASSNAME;
     public static final String WEBINF_DIR_NAME = "WEB-INF";
     public static final String WEBINF_SRC_DIR = "/" + WEBINF_DIR_NAME + "/src";
+    public static final String GLOBALAPP_URI =
+            WEBINF_SRC_DIR + '/' + GLOBALAPP_FULL_CLASSNAME.replace( '.', '/' 
) + GLOBALAPP_FILE_EXTENSION_DOT;
     public static final String TMP_SRC_DIR = "WEB-INF" + File.separatorChar + 
".tmpbeansrc" + File.separatorChar;
     public static final String ANNOTATION_QUALIFIER = PAGEFLOW_PACKAGE + 
".annotations.Jpf.";
     public static final String ANNOTATION_INTERFACE_PREFIX = "Jpf.";

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
   Fri Aug 13 23:06:05 2004
@@ -34,6 +34,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
@@ -43,22 +44,33 @@
         extends FlowControllerChecker
         implements JpfLanguageConstants
 {
+    private static final FilenameFilter SHARED_FLOW_FILE_FILTER = new 
SharedFlowFileFilter();
+    
+    
     public PageFlowChecker( AnnotationProcessorEnvironment env, Diagnostics 
diagnostics, FlowControllerInfo fcInfo )    
     {
         super( env, diagnostics, fcInfo );
     }
 
-    public static class PageFlowFileFilter implements FilenameFilter
+    private static class PageFlowFileFilter implements FilenameFilter
     {
         public boolean accept( File dir, String name )
         {
-            return name.endsWith( JPF_FILE_EXTENSION_DOT );
+            return name.endsWith( JPF_FILE_EXTENSION_DOT ) || name.endsWith( 
JAVA_FILE_EXTENSION_DOT );
+        }
+    }
+    
+    private static class SharedFlowFileFilter implements FilenameFilter
+    {
+        public boolean accept( File dir, String name )
+        {
+            return name.endsWith( SHARED_FLOW_FILE_EXTENSION_DOT ) || 
name.endsWith( JAVA_FILE_EXTENSION_DOT );
         }
     }
 
     public BaseGenerator getGenerator()
     {
-        return new PageFlowGenerator( getEnv() );
+        return new PageFlowGenerator( getEnv(), getFlowControllerInfo() );
     }
 
     protected void startCheckClass( ClassDeclaration jclass )
@@ -67,38 +79,55 @@
         // First, find the SharedFlow.jpfs file (or Global.app, for legacy 
apps).  Crawl up through the directories,
         // looking for SharedFlow.jpfs files.  The first one found is the 
applicable one.
         //
-        PackageDeclaration outerTypePackage = jclass.getPackage();
-        TypeDeclaration sharedFlowType = null;
+        File jpfFile = CompilerUtils.getOriginalFile( jclass );
+        List< File > sharedFlowFileHierarchy = new ArrayList< File >();
+        List< TypeDeclaration > sharedFlowTypeHierarchy = new ArrayList< 
TypeDeclaration >();
+        
+        String webappRootPath = getWebappRoot().getPath();
         
-        assert outerTypePackage != null;
-        String packageName = outerTypePackage.getQualifiedName();
-        assert packageName != null;
-        if ( ! packageName.equals( "" ) )
+        for ( File i = jpfFile.getAbsoluteFile().getParentFile(); i != null; i 
= i.getParentFile() )
         {
-            while ( true )
+            File[] sharedFlowFiles = i.listFiles( SHARED_FLOW_FILE_FILTER );
+            boolean atWebappRoot = i.equals( getWebappRoot() );
+            
+            if ( sharedFlowFiles.length > 0 )
             {
-                sharedFlowType = getEnv().getTypeDeclaration( packageName + 
'.' + SHARED_FLOW_CLASSNAME );
-                if ( sharedFlowType != null ) break;
-                int lastDot = packageName.lastIndexOf( '.' );
-                if ( lastDot == -1 ) break;
-                packageName = packageName.substring( 0, lastDot );
+                File sfFile = sharedFlowFiles[0];
+                TypeDeclaration sfType =
+                        atWebappRoot ?
+                        getEnv().getTypeDeclaration( WEBAPP_ROOT_PACKAGE + '.'
+                                                     + 
CompilerUtils.removeFileExtension( sfFile.getName() ) ):
+                        CompilerUtils.inferTypeFromFile( sfFile, 
webappRootPath, getEnv() );
+                
+                if ( sfType != null && CompilerUtils.isAssignableFrom( 
SHARED_FLOW_BASE_CLASS, sfType, getEnv() ) )
+                {
+                    sharedFlowFileHierarchy.add( sfFile );
+                    sharedFlowTypeHierarchy.add( sfType );
+                }
             }
+            
+            if ( atWebappRoot ) break;
         }
         
-        if ( sharedFlowType == null )
-        {
-            sharedFlowType = getEnv().getTypeDeclaration( 
SHARED_FLOW_CLASSNAME );
-        }
-        
-        if ( sharedFlowType == null )
+        //
+        // If there's no SharedFlowController, fall back to the deprecated 
Global.app.
+        //
+        if ( sharedFlowTypeHierarchy.isEmpty() )
         {
-            //
-            // Finally, look for it in Global.app.
-            //
-            sharedFlowType = getEnv().getTypeDeclaration( 
GLOBALAPP_FULL_CLASSNAME );
+            File globalAppFile = new File( webappRootPath + GLOBALAPP_URI );
+            if ( globalAppFile.exists() )
+            {
+                TypeDeclaration type = getEnv().getTypeDeclaration( 
GLOBALAPP_FULL_CLASSNAME );
+                
+                if ( type != null )
+                {
+                    sharedFlowFileHierarchy.add( globalAppFile );
+                    sharedFlowTypeHierarchy.add( type );
+                }
+            }
         }
         
-        getFlowControllerInfo().setSharedFlowType( sharedFlowType );
+        getFlowControllerInfo().setSharedFlowInfo( sharedFlowTypeHierarchy, 
sharedFlowFileHierarchy );
         
         super.startCheckClass( jclass );
     }
@@ -135,7 +164,7 @@
         //
         String jpfPackageName = pkg.getQualifiedName();
         File parentDir = CompilerUtils.getOriginalFile( jpfClass 
).getAbsoluteFile().getParentFile();
-        if ( parentDir.equals( webappRoot.getPath() ) )
+        if ( parentDir.equals( webappRoot ) )
         {
             if ( jpfPackageName != null && jpfPackageName.length() > 0 )
             {
@@ -200,10 +229,10 @@
         return JPF_BASE_CLASS;
     }
 
-    protected GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage )
+    protected GenStrutsApp createStrutsApp( File sourceFile, ClassDeclaration 
jclass )
         throws XmlException, IOException, NoWebInfDirectoryException
     {
-        return new GenStrutsApp( sourceFile, containingPackage, null, getEnv() 
);
+        return new GenStrutsApp( sourceFile, jclass, getEnv(), 
getFlowControllerInfo() );
     }
 
     protected AnnotationGrammar getControllerGrammar()
@@ -233,7 +262,7 @@
             protected Object onCheck( AnnotationTypeElementDeclaration 
valueDecl, AnnotationValue value,
                                       AnnotationMirror parentAnnotation, 
MemberDeclaration classMember )
             {
-                boolean isSingleton = ( ( Boolean ) value.getValue() 
).booleanValue();
+                boolean isSingleton = ( Boolean ) value.getValue();
                 if ( isSingleton && CompilerUtils.isInNestedPageFlow( 
classMember ) )
                 {
                     addError( value, "error.nested-singleton" );

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowGenerator.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowGenerator.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowGenerator.java
 Fri Aug 13 23:06:05 2004
@@ -26,22 +26,21 @@
 
 import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException;
 import org.apache.beehive.netui.compiler.genmodel.GenStrutsApp;
-import org.apache.beehive.netui.compiler.FlowControllerGenerator;
 import org.apache.xmlbeans.XmlException;
 
 
 public class PageFlowGenerator
         extends FlowControllerGenerator
 {
-    public PageFlowGenerator( AnnotationProcessorEnvironment env )
+    public PageFlowGenerator( AnnotationProcessorEnvironment env, 
FlowControllerInfo fcInfo )
     {
-        super( env );
+        super( env, fcInfo );
     }
 
-    protected GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage, ClassDeclaration jclass )
+    protected GenStrutsApp createStrutsApp( File sourceFile, ClassDeclaration 
jclass )
                  
         throws XmlException, IOException, NoWebInfDirectoryException
     {
-        return new GenStrutsApp( sourceFile, containingPackage, jclass, 
getEnv() );
+        return new GenStrutsApp( sourceFile, jclass, getEnv(), 
getFlowControllerInfo() );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowChecker.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowChecker.java
 Fri Aug 13 23:06:05 2004
@@ -42,18 +42,24 @@
 
     public BaseGenerator getGenerator()
     {
-        return new SharedFlowGenerator( getEnv() );
+        return new SharedFlowGenerator( getEnv(), getFlowControllerInfo() );
     }
 
     protected void doAdditionalClassChecks( ClassDeclaration jclass, File 
webappRoot )
     {
+        String pkg = jclass.getPackage().getQualifiedName();              
+        
+        if ( pkg.length() == 0 )
+        {
+            getDiagnostics().addError( jclass, "error.wrong-package", 
WEBAPP_ROOT_PACKAGE );
+        }
+        
         //
-        // If it's Global.app, make sure the package is "global", and that 
it's in /WEB-INf/src/global.
+        // If it's Global.app, make sure the package is "global".
         //
         if ( CompilerUtils.isAssignableFrom( GLOBALAPP_BASE_CLASS, jclass, 
getEnv() ) )
         {
-            PackageDeclaration pkg = jclass.getPackage();              
-            if ( pkg == null || ! pkg.getQualifiedName().toString().equals( 
GLOBALAPP_PACKAGE ) )
+            if ( ! pkg.equals( GLOBALAPP_PACKAGE ) )
             {
                 getDiagnostics().addError( jclass, "error.wrong-package", 
GLOBALAPP_PACKAGE );
             }
@@ -68,15 +74,10 @@
         return null;
     }
 
-    protected boolean isSharedFlow()
-    {
-        return true;
-    }
-
-    protected GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage )
+    protected GenStrutsApp createStrutsApp( File sourceFile, ClassDeclaration 
jclass )
         throws XmlException, IOException, NoWebInfDirectoryException
     {
-        return new GenSharedFlowStrutsApp( sourceFile, containingPackage, 
null, getEnv() );
+        return new GenSharedFlowStrutsApp( sourceFile, jclass, getEnv(), null 
);
     }
 
     protected AnnotationGrammar getControllerGrammar()

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowGenerator.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowGenerator.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/SharedFlowGenerator.java
       Fri Aug 13 23:06:05 2004
@@ -24,7 +24,6 @@
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.beehive.netui.compiler.FlowControllerGenerator;
 import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException;
 import org.apache.beehive.netui.compiler.genmodel.GenStrutsApp;
 import org.apache.beehive.netui.compiler.genmodel.GenSharedFlowStrutsApp;
@@ -34,14 +33,14 @@
 public class SharedFlowGenerator
     extends FlowControllerGenerator
 {
-    public SharedFlowGenerator( AnnotationProcessorEnvironment env )
+    public SharedFlowGenerator( AnnotationProcessorEnvironment env, 
FlowControllerInfo fcInfo )
     {
-        super( env );
+        super( env, fcInfo );
     }
 
-    protected GenStrutsApp createStrutsApp( File sourceFile, String 
containingPackage, ClassDeclaration jclass )
+    protected GenStrutsApp createStrutsApp( File sourceFile, ClassDeclaration 
jclass )
             throws XmlException, IOException, NoWebInfDirectoryException
     {
-        return new GenSharedFlowStrutsApp( sourceFile, containingPackage, 
jclass, getEnv() );
+        return new GenSharedFlowStrutsApp( sourceFile, jclass, getEnv(), 
getFlowControllerInfo() );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
   Fri Aug 13 23:06:05 2004
@@ -21,7 +21,7 @@
 import com.sun.mirror.declaration.ClassDeclaration;
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import org.apache.beehive.netui.compiler.model.NoWebInfDirectoryException;
-import org.apache.beehive.netui.compiler.CompilerUtils;
+import org.apache.beehive.netui.compiler.FlowControllerInfo;
 import org.apache.xmlbeans.XmlException;
 
 import java.io.File;
@@ -30,17 +30,18 @@
 public class GenSharedFlowStrutsApp
         extends GenStrutsApp
 {
-    private static final String SHAREDFLOW_MODULE_PREFIX = "shared";
-    
     private boolean _isGlobalApp;
     
     
-    public GenSharedFlowStrutsApp( File sourceFile, String containingPackage, 
ClassDeclaration jclass, AnnotationProcessorEnvironment env )
+    public GenSharedFlowStrutsApp( File sourceFile, ClassDeclaration jclass, 
AnnotationProcessorEnvironment env,
+                                   FlowControllerInfo fcInfo )
             throws NoWebInfDirectoryException, XmlException, IOException
     {
-        super( sourceFile, containingPackage, jclass, env );
-        _isGlobalApp = GLOBALAPP_PACKAGE.equals( containingPackage ) && 
sourceFile.getName().startsWith( GLOBALAPP_CLASSNAME );
+        super( sourceFile, jclass, env, fcInfo );
+        _isGlobalApp = GLOBALAPP_PACKAGE.equals( 
jclass.getPackage().getQualifiedName() ) 
+                       && sourceFile.getName().startsWith( GLOBALAPP_CLASSNAME 
);
         recalculateStrutsConfigFile();  // it changes based on _isGlobalApp
+        setSharedFlow( true );
     }
     
     protected boolean isModuleDeclaredInWebXml()
@@ -48,13 +49,8 @@
         return _isGlobalApp;
     }
     
-    protected void prefixModuleFileName( StringBuffer strutsFileName )
+    String getStrutsConfigURI()
     {
-        strutsFileName.append( STRUTS_CONFIG_SEPARATOR );
-        
-        if ( ! _isGlobalApp )
-        {
-            strutsFileName.append( SHAREDFLOW_MODULE_PREFIX );
-        }
+        return getStrutsConfigURI( getContainingPackage(), true );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
     Fri Aug 13 23:06:05 2004
@@ -25,6 +25,7 @@
 import org.apache.beehive.netui.compiler.model.ActionModel;
 import org.apache.beehive.netui.compiler.CompilerUtils;
 import org.apache.beehive.netui.compiler.JpfLanguageConstants;
+import org.apache.beehive.netui.compiler.FlowControllerInfo;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
@@ -66,14 +67,14 @@
         _strutsConfigFile = calculateStrutsConfigFile(); // caching this
     }
     
-    public GenStrutsApp( File sourceFile, String containingPackage, 
ClassDeclaration jclass,
-                         AnnotationProcessorEnvironment env )
+    public GenStrutsApp( File sourceFile, ClassDeclaration jclass, 
AnnotationProcessorEnvironment env,
+                         FlowControllerInfo fcInfo )
         throws NoWebInfDirectoryException, XmlException, IOException
     {
-        super();
+        super( jclass.getQualifiedName() );
         
         _jclass = jclass;
-        _containingPackage = containingPackage;
+        _containingPackage = jclass.getPackage().getQualifiedName();
         _sourceFile = sourceFile;
         _webappRoot = getWebappRootFromJpf( sourceFile ).getAbsoluteFile();
         _env = env;
@@ -100,6 +101,11 @@
             addActionMethods();
             addFormBeans( _jclass );
         }
+        
+        if ( fcInfo != null )
+        {
+            setSharedFlowTypeNames( fcInfo.getSharedFlowTypeNameHierarchy() );
+        }
     }
     
     private void addFormBeans( ClassDeclaration jclass )
@@ -259,40 +265,25 @@
         return webappRelativeSourceFile.lastIndexOf( '/' ) == 0;
     }
     
-    protected void prefixModuleFileName( StringBuffer moduleFileName )
+    String getOutputFileURI( String filePrefix )
     {
+        return getOutputFileURI( filePrefix, _containingPackage, false );
     }
     
-    /**
-     * Get the webapp-relative URI of the output file, with the given basename.
-     */ 
-    String getOutputFileURI( String fileBaseName )
+    String getStrutsConfigURI()
     {
-        StringBuffer strutsFileName = new StringBuffer( 
STRUTSCONFIG_OUTPUT_DIR );
-        strutsFileName.append( '/' ).append( fileBaseName );
-        
-        // Allow derived class to add pieces to the filename.
-        prefixModuleFileName( strutsFileName );
-        
-        if ( _containingPackage != null && _containingPackage.length() > 0 )
-        {
-            strutsFileName.append( STRUTS_CONFIG_SEPARATOR );
-            strutsFileName.append( _containingPackage.replace( '.', 
STRUTS_CONFIG_SEPARATOR ) );
-        }
-        
-        strutsFileName.append( STRUTS_CONFIG_EXTENSION );
-        return strutsFileName.toString();
+        return getStrutsConfigURI( _containingPackage, false );
     }
-    
-    File getOutputFileForModule( String fileBaseName )
+
+    protected String getContainingPackage()
     {
-        return new File( _webappRoot.getPath() + getOutputFileURI( 
fileBaseName ) );
+        return _containingPackage;
     }
     
     private File calculateStrutsConfigFile()
         throws XmlException, IOException
     {
-        File strutsConfigFile = getOutputFileForModule( STRUTS_CONFIG_PREFIX );
+        File strutsConfigFile = new File( _webappRoot.getPath() + 
getStrutsConfigURI() );
         
         //
         // For the root Controller.jpf and for Global.app, we have to look in 
web.xml to get the output location.
@@ -585,5 +576,10 @@
     AnnotationProcessorEnvironment getEnv()
     {
         return _env;
+    }
+
+    public File getWebappRoot()
+    {
+        return _webappRoot;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
       Fri Aug 13 23:06:05 2004
@@ -380,7 +380,7 @@
     public void writeToFile()
         throws FileNotFoundException, XmlException, IOException
     {
-        File outputFile = _strutsApp.getOutputFileForModule( 
STRUTS_VALIDATION_PREFIX );
+        String outputFile = _strutsApp.getWebappRoot() + 
_strutsApp.getOutputFileURI( STRUTS_VALIDATION_PREFIX );
         writeXml( new PrintStream( new FileOutputStream( outputFile ) ), null 
);    // @TODO need to pass in the merge file
     }
 

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathOrActionType.java
    Fri Aug 13 23:06:05 2004
@@ -29,6 +29,7 @@
 import com.sun.mirror.declaration.MethodDeclaration;
 
 import java.util.Collection;
+import java.util.List;
 
 public class WebappPathOrActionType
         extends WebappPathType
@@ -58,11 +59,11 @@
 
                 if ( ! foundIt )
                 {
-                    TypeDeclaration sharedFlowType = 
_fcInfo.getSharedFlowType();
+                    List< TypeDeclaration > sharedFlowTypeHierarchy = 
_fcInfo.getSharedFlowTypeHierarchy();
                     
-                    if ( sharedFlowType != null )
+                    if ( sharedFlowTypeHierarchy != null && 
sharedFlowTypeHierarchy.size() > 0 )
                     {
-                        foundIt = actionExists( actionMethodName, 
sharedFlowType, null );
+                        foundIt = actionExists( actionMethodName, 
sharedFlowTypeHierarchy.get( 0 ), null );
                     }
                 }
                 

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/grammar/WebappPathType.java
    Fri Aug 13 23:06:05 2004
@@ -107,9 +107,8 @@
             
             if ( stringValue.endsWith( JPF_FILE_EXTENSION_DOT ) )
             {
-                String className = stringValue.substring( 1, 
stringValue.length() - JPF_FILE_EXTENSION_DOT.length() );
-                className = className.replace( '/', '.' );
-                fileToCheck = checkJpf( className );
+                TypeDeclaration type = CompilerUtils.inferTypeFromPath( 
stringValue, getEnv() );
+                fileToCheck = type != null ? CompilerUtils.getOriginalFile( 
type ) : null;
                 if ( fileToCheck == null ) fileExists = false;
             }
             else
@@ -143,7 +142,8 @@
                 String className = stringValue.substring( 0, 
stringValue.length() - JPF_FILE_EXTENSION_DOT.length() );
                 className = 
classMember.getDeclaringType().getPackage().getQualifiedName()
                             + '.' + className.replace( '/', '.' );
-                fileToCheck = checkJpf( className );
+                TypeDeclaration type = getEnv().getTypeDeclaration( className 
);
+                fileToCheck = type != null ? CompilerUtils.getOriginalFile( 
type ) : null;
                 if ( fileToCheck == null ) fileExists = false;
             }
             else
@@ -193,12 +193,6 @@
         }
         
         return null;
-    }
-    
-    private File checkJpf( String className )
-    {
-        TypeDeclaration type = getEnv().getTypeDeclaration( className );
-        return type != null ? CompilerUtils.getOriginalFile( type ) : null;
     }
     
     protected boolean checkAnyExtension()

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
   Fri Aug 13 23:06:05 2004
@@ -58,6 +58,9 @@
     private boolean _returnToActionDisabled = true;
     private boolean _isNestedPageFlow = false;
     private boolean _isSingletonPageFlow = false;
+    private boolean _isSharedFlow = false;
+    private List< String > _sharedFlowTypeNames = null;
+    private String _controllerClassName;
     
 
     protected static final String DUPLICATE_ACTION_COMMENT = "Note that there 
is more than one action with path \"{0}\"."
@@ -80,10 +83,11 @@
     protected static final String DEFAULT_VALIDATOR_RULES_URI = "/" + 
WEBINF_DIR_NAME + "/validator-rules.xml";
 
     
-    public StrutsApp()
+    public StrutsApp( String controllerClassName )
     {
         super( null );
         setParentApp( this );
+        _controllerClassName = controllerClassName;
         
         //
         // Add a reference for the default validation message resources (in 
beehive-netui-pageflow.jar).
@@ -273,18 +277,10 @@
 
         for ( dir = jpf.getAbsoluteFile().getParentFile(); dir != null && 
webappRoot == null; dir = dir.getParentFile() )
         {
-            String[] children = dir.list();
-
-            if ( children != null )
+            if ( new File( dir, WEBINF_DIR_NAME ).isDirectory() )
             {
-                for ( int c = 0; c < children.length; c++ )
-                {
-                    if ( children[c].equalsIgnoreCase( WEBINF_DIR_NAME ) )
-                    {
-                        webappRoot = dir;
-                        break;
-                    }
-                }
+                webappRoot = dir;
+                break;
             }
         }
 
@@ -783,9 +779,30 @@
             
             if ( _isNestedPageFlow ) addSetProperty( controller, 
"isNestedPageFlow", "true" );
             if ( _isSingletonPageFlow ) addSetProperty( controller, 
"isSingletonPageFlow", "true" );
+            if ( _isSharedFlow ) addSetProperty( controller, "isSharedFlow", 
"true" );
             if ( isReturnToPageDisabled() ) addSetProperty( controller, 
"isReturnToPageDisabled", "true" );
             if ( isReturnToActionDisabled() ) addSetProperty( controller, 
"isReturnToActionDisabled", "true" );
             
+            if ( _sharedFlowTypeNames != null )
+            {
+                StringBuilder sharedFlowModules = new StringBuilder();
+                
+                for ( Iterator< String > i = _sharedFlowTypeNames.iterator(); 
i.hasNext(); )
+                {
+                    String typeName = i.next();
+                    int lastDot = typeName.lastIndexOf( '.' );
+                    String containingPackage = lastDot != -1 ? 
typeName.substring( 0, lastDot ) : null;
+                    if ( sharedFlowModules.length() > 0 ) 
sharedFlowModules.append( ';' );
+                    sharedFlowModules.append( '/' );
+                    sharedFlowModules.append( STRUTS_CONFIG_SEPARATOR );
+                    sharedFlowModules.append( containingPackage.replace( '.', 
'/' ) );
+               }
+                
+               addSetProperty( controller, "sharedFlowModules", 
sharedFlowModules.toString() );
+            }
+            
+            addSetProperty( controller, "controllerClass", 
_controllerClassName );
+            
             //
             // If there is not a default MessageResources element in the 
generated XML, add a special set-property
             // to communicate this to the runtime.
@@ -800,7 +817,7 @@
         } 
     }
     
-    protected void addSetProperty( ControllerDocument.Controller controller, 
String propName, String propValue )
+    protected static void addSetProperty( ControllerDocument.Controller 
controller, String propName, String propValue )
     {
         controller.setClassName( PAGEFLOW_CONTROLLER_CONFIG_CLASSNAME );
         SetPropertyDocument.SetProperty prop = controller.addNewSetProperty();
@@ -865,5 +882,34 @@
     public void setSingletonPageFlow( boolean singletonPageFlow )
     {
         _isSingletonPageFlow = singletonPageFlow;
+    }
+    
+    protected static String getStrutsConfigURI( String containingPackage, 
boolean isSharedFlow )
+    {
+        return getOutputFileURI( STRUTS_CONFIG_PREFIX, containingPackage, 
isSharedFlow );
+    }
+    
+    public static String getOutputFileURI( String filePrefix, String 
containingPackage, boolean isSharedFlow )
+    {
+        StringBuilder fileName = new StringBuilder( STRUTSCONFIG_OUTPUT_DIR );
+        fileName.append( '/' ).append( filePrefix );
+        if ( containingPackage != null && containingPackage.length() > 0 )
+        {
+            fileName.append( STRUTS_CONFIG_SEPARATOR );
+        }
+        if ( isSharedFlow ) fileName.append( STRUTS_CONFIG_SEPARATOR );
+        if ( containingPackage != null ) fileName.append( 
containingPackage.replace( '.', STRUTS_CONFIG_SEPARATOR ) );
+        fileName.append( STRUTS_CONFIG_EXTENSION );
+        return fileName.toString();
+    }
+    
+    protected void setSharedFlow( boolean sharedFlow )
+    {
+        _isSharedFlow = sharedFlow;
+    }
+
+    protected void setSharedFlowTypeNames( List< String > sharedFlowTypeNames )
+    {
+        _sharedFlowTypeNames = sharedFlowTypeNames;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
 Fri Aug 13 23:06:05 2004
@@ -45,7 +45,6 @@
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
-import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
@@ -67,6 +66,7 @@
 import org.apache.beehive.netui.util.logging.Logger;
 import org.apache.beehive.netui.pageflow.internal.ContextCache;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.handler.ForwardRedirectHandler;
 
 
 /**
@@ -549,20 +549,21 @@
             else
             {
                 //
-                // If we couldn't find an appropriate module, try raising the 
action on Global.app if it exists.
+                // If we couldn't find an appropriate module, try raising the 
action on the appropriate
+                // SharedFlowController, if one exists.
                 //
-                GlobalApp globalApp = InternalUtils.ensureGlobalApp( request, 
response, servletContext );
+                SharedFlowController sf =
+                        FlowControllerFactory.getSharedFlowForRequest( 
request, response, servletContext );
                 String uri = InternalUtils.decodeURI( request );
                 
-                if ( globalApp != null )
+                if ( sf != null )
                 {
-                    StringBuilder globalAppURI = new StringBuilder( 
PageFlowConstants.GLOBALAPP_MODULE_CONTEXT_PATH );
-                    globalAppURI.append( '/' );
-                    globalAppURI.append( ServletUtils.getBaseName( uri ) );
-                    RequestDispatcher rd = request.getRequestDispatcher( 
globalAppURI.toString() );
-                    assert rd != null;
-                    RequestVariables.get( request ).setOriginalRequestURI( 
InternalUtils.decodeURI( request ) );
-                    rd.forward( request, response );
+                    StringBuilder sfActionURI = new StringBuilder( 
sf.getModulePath() );
+                    sfActionURI.append( '/' );
+                    sfActionURI.append( ServletUtils.getBaseName( uri ) );
+                    RequestVariables.get( request ).setOriginalRequestURI( uri 
);
+                    ForwardRedirectHandler frh = ContextCache.get( 
servletContext ).getForwardRedirectHandler();
+                    frh.forward( sfActionURI.toString(), request, response );
                     return;
                 }
                 

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
    Fri Aug 13 23:06:05 2004
@@ -200,7 +200,7 @@
     protected void sendError( String errText, HttpServletRequest request, 
HttpServletResponse response )
         throws IOException
     {
-        InternalUtils.sendError( "PageFlow_Custom_Error", request, response, 
null, getURI(), errText );
+        InternalUtils.sendError( "PageFlow_Custom_Error", request, response, 
null, getDisplayName(), errText );
     }
     
     public static Locale retrieveUserLocale( HttpServletRequest request, 
String locale )
@@ -1677,4 +1677,6 @@
         
         return new Forward( DEFAULT_SIMPLE_ACTION_FORWARD_NAME );
     }
+    
+    abstract void setImplicitObject( HttpServletRequest request );
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
     Fri Aug 13 23:06:05 2004
@@ -51,13 +51,7 @@
     public static PageFlowController getPageFlowForRequest( HttpServletRequest 
request,  HttpServletResponse response,
                                                             ServletContext 
servletContext )
     {
-        // Use the parent directory name as the .jpf name.  An alternative 
would
-        // be to look for the PageFlowController.class somewhere in the 
ModuleConfig
-        // associated with the current URI path.
-        String relativeUrl = PageFlowUtils.getRelativeURI( request, 
InternalUtils.decodeURI( request ), null );
-        String parentDir = PageFlowUtils.getModulePathForRelativeURI( 
relativeUrl );
-        String jpfClassName = InternalUtils.getPageFlowClassName( parentDir, 
request, servletContext );
-        return jpfClassName != null ? getPageFlow( jpfClassName, request, 
response, servletContext ) : null;
+        return getPageFlowForURI( request, response, InternalUtils.decodeURI( 
request ), servletContext );
     }    
     
     /**
@@ -73,16 +67,54 @@
      * @return the PageFlowController for the request, or <code>null</code> if 
none was found
      *             and none could be created.
      */
-    public static FlowController getPageFlowForURI( HttpServletRequest 
request, HttpServletResponse response,
-                                                    String uri, ServletContext 
servletContext )
+    public static PageFlowController getPageFlowForURI( HttpServletRequest 
request, HttpServletResponse response,
+                                                        String uri, 
ServletContext servletContext )
     {
-        // Use the parent directory name as the .jpf name.  An alternative 
would
-        // be to look for the PageFlowController.class somewhere in the 
ModuleConfig
-        // associated with the current URI path.
-        String relativeUrl = PageFlowUtils.getRelativeURI( request, uri, null 
);
-        String parentDir = PageFlowUtils.getModulePathForRelativeURI( 
relativeUrl );
-        String jpfClassName = InternalUtils.getPageFlowClassName( parentDir, 
request, servletContext );
-        return jpfClassName != null ? getPageFlow( jpfClassName, request, 
response, servletContext ) : null;
+        PageFlowController cur = InternalUtils.getCurrentPageFlow( request, 
false );
+        String parentDir =
+                PageFlowUtils.getModulePathForRelativeURI( 
PageFlowUtils.getRelativeURI( request, uri, null ) );
+        
+        //
+        // If there's no current PageFlow, or if the current 
PageFlowController has a module path that
+        // is incompatible with the current request URI, then create the 
appropriate PageFlowController.
+        //
+        if ( cur == null || ! PageFlowUtils.getModulePathForRelativeURI( 
cur.getURI() ).equals( parentDir ) )
+        {
+            String jpfClassName = InternalUtils.getFlowControllerClassName( 
parentDir, request, servletContext );
+            return jpfClassName != null ? getPageFlow( jpfClassName, request, 
response, servletContext ) : null;
+        }
+        
+        //
+        // Reinitialize transient data that may have been lost on session 
failover.
+        //
+        cur.reinitialize( request, response, servletContext );
+        return cur;
+    }    
+    
+    public static SharedFlowController getSharedFlowForRequest( 
HttpServletRequest request,
+                                                                
HttpServletResponse response,
+                                                                ServletContext 
servletContext )
+    {
+        return getSharedFlowForURI( request, response, 
InternalUtils.decodeURI( request ), servletContext );
+    }
+    
+    public static SharedFlowController getSharedFlowForURI( HttpServletRequest 
request, HttpServletResponse response,
+                                                            String uri, 
ServletContext servletContext )
+    {
+        String className = InternalUtils.getSharedFlowClassNameForURI( uri, 
request, servletContext );
+        if ( className == null ) return null;
+        SharedFlowController cur = PageFlowUtils.getSharedFlow( className, 
request );
+        
+        if ( cur != null )
+        {
+            //
+            // Reinitialize transient data that may have been lost on session 
failover.
+            //
+            cur.reinitialize( request, response, servletContext );
+            return cur;
+        }
+        
+        return getSharedFlow( className, request, response ,servletContext );
     }    
     
     /**
@@ -101,11 +133,11 @@
         try
         {
             Class jpfClass = InternalUtils.getReloadableClass( jpfClassName, 
request, servletContext );
-            return getPageFlow( jpfClass, request, response, servletContext, 
true );
+            return getPageFlow( jpfClass, request, response, servletContext );
         }
         catch ( ClassNotFoundException e)
         {
-            if ( _log.isInfoEnabled() ) _log.info( "Requested page flow class 
" + jpfClassName + " not found." );
+            if ( _log.isErrorEnabled() ) _log.error( "Requested page flow 
class " + jpfClassName + " not found." );
             return null;
         }
     }    
@@ -121,263 +153,212 @@
     public static GlobalApp getGlobalApp( HttpServletRequest request, 
HttpServletResponse response,
                                           ServletContext servletContext )
     {
+        SharedFlowController sf =
+                getSharedFlow( PageFlowConstants.GLOBALAPP_CLASSNAME, request, 
response, servletContext );
+        return sf instanceof GlobalApp ? ( GlobalApp ) sf : null;
+    }    
+    
+    public static SharedFlowController getSharedFlow( String 
sharedFlowClassName, HttpServletRequest request,
+                                                      HttpServletResponse 
response, ServletContext servletContext )
+    {
         try
         {
-            Class globalAppClass =
-                    InternalUtils.getReloadableClass( 
PageFlowConstants.GLOBALAPP_CLASSNAME, request, servletContext );
-            return getGlobalApp( globalAppClass, request, response, 
servletContext );
+            Class sfClass = InternalUtils.getReloadableClass( 
sharedFlowClassName, request, servletContext );
+            return getSharedFlow( sfClass, request, response, servletContext );
         }
         catch ( ClassNotFoundException e )
         {
-            _log.info( "Global.app class not found." );
+            if ( _log.isErrorEnabled() )
+            {
+                _log.error( "Requested SharedFlowController class " + 
sharedFlowClassName + " not found." );
+            }
+            
             return null;
         }
     }    
     
     /**
-     * Delegates to [EMAIL PROTECTED] #getPageFlow} or [EMAIL PROTECTED] 
#getGlobalApp} as appropriate,
-     * depending on the given class type.
-     */
-    static FlowController getFlowController( Class fcClass, HttpServletRequest 
request,
-                                             HttpServletResponse response, 
ServletContext servletContext )
-    {
-        if ( PageFlowController.class.isAssignableFrom( fcClass ) )
-        {
-            return getPageFlow( fcClass, request, response, servletContext, 
true );
-        }
-        else
-        {
-            assert GlobalApp.class.isAssignableFrom( fcClass ) : 
fcClass.getName();
-            return getGlobalApp( fcClass, request, response, servletContext );
-        }
-    }
-    
-    /**
-     * If the current session's PageFlowController is of the given class, it 
will be returned;
-     * otherwise, a new one will be created.  The PageFlowController stack 
(for nesting) will be
-     * cleared or pushed, and the new instance will be stored as the current 
PageFlowController.
+     * Get the [EMAIL PROTECTED] PageFlowController} for the given type.  The 
PageFlowController stack (for
+     * nesting) will be cleared or pushed, and the new instance will be stored 
as the current
+     * PageFlowController.
+     * 
+     * @param jpfClass the desired PageFlowController class.
+     * @param request the current HttpServletRequest.
+     * @return the current user session's PageFlowController if it is of the 
requested type,
+     *         or a newly-created one, or <code>null</code> if none could be 
found or created.
      */
-    static PageFlowController getPageFlow( Class jpfClass, HttpServletRequest 
request,
-                                           HttpServletResponse response, 
ServletContext servletContext,
-                                           boolean useCurrentIfAppropriate )
+    public static PageFlowController getPageFlow( Class jpfClass, 
HttpServletRequest request,
+                                                  HttpServletResponse 
response, ServletContext servletContext )
     {
         if ( ! PageFlowController.class.isAssignableFrom( jpfClass ) )
         {
             return null;
         }
         
-        PageFlowController current = InternalUtils.getCurrentPageFlow( 
request, false );
-
-        if ( current != null && useCurrentIfAppropriate && 
current.getClass().equals( jpfClass ) )
+        try
         {
-            if ( _log.isDebugEnabled() )
-            {
-                _log.debug( "Using current PageFlow: " + current );
-            }
-
             //
-            // Reinitialize transient data that may have been lost on session 
failover.
+            // First check if this is a request for a singleton page flow.  If 
so, try
+            // PageFlowUtils.getCurrentPageFlow again, with the singleton flag.
             //
-            current.reinitialize( request, response, servletContext );
-            return current;
-        }
-        else
-        {
-            try
+            PageFlowController retVal = null;
+            String modulePath = PageFlowUtils.getModulePath( request );
+            ModuleConfig mc = InternalUtils.getModuleConfig( modulePath, 
servletContext );
+            boolean createdNew = false;
+            
+            if ( mc != null && InternalUtils.isSingleton( mc ) )
             {
-                //
-                // First check if this is a request for a singleton page flow. 
 If so, try
-                // PageFlowUtils.getCurrentPageFlow again, with the singleton 
flag.
-                //
-                PageFlowController retVal = null;
-                String modulePath = PageFlowUtils.getModulePath( request );
-                ModuleConfig mc = InternalUtils.getModuleConfig( modulePath, 
servletContext );
-                boolean createdNew = false;
+                retVal = InternalUtils.getSingletonPageFlow( modulePath, 
request, false );
                 
-                if ( mc != null && InternalUtils.isSingleton( mc ) )
+                if ( _log.isDebugEnabled() )
                 {
-                    retVal = InternalUtils.getSingletonPageFlow( modulePath, 
request, false );
-                    
-                    if ( _log.isDebugEnabled() )
+                    if ( retVal != null )
                     {
-                        if ( retVal != null )
-                        {
-                            _log.debug( "Using singleton PageFlowController of 
type " + jpfClass.getName() );
-                        }
+                        _log.debug( "Using singleton PageFlowController of 
type " + jpfClass.getName() );
                     }
                 }
+            }
+            
+            if ( retVal == null )
+            {
+                if ( _log.isDebugEnabled() )
+                {
+                    _log.debug( "Creating PageFlowController of type " + 
jpfClass.getName() );
+                }
+
+                retVal = ( PageFlowController ) jpfClass.newInstance();
+                createdNew = true;
+            }
+            
+            //
+            // Store the previous PageFlowController on the nesting stack (if 
this one is nestable),
+            // or destroy the nesting stack.
+            //
+            if ( retVal.isNestable( request, servletContext ) )
+            {
+                //
+                // Call create() on the newly-created page flow.
+                //
+                retVal.create( request, response, servletContext );
+                PageFlowController current = InternalUtils.getCurrentPageFlow( 
request, false );
                 
-                if ( retVal == null )
+                if ( current != null )
                 {
                     if ( _log.isDebugEnabled() )
                     {
-                        _log.debug( "Creating PageFlowController of type " + 
jpfClass.getName() );
+                        _log.debug( "Pushing PageFlowController " + current + 
" onto the nesting stack" );
                     }
-    
-                    retVal = ( PageFlowController ) jpfClass.newInstance();
-                    createdNew = true;
+
+                    PageFlowStack pfStack = PageFlowStack.get( request );
+                    pfStack.push( current, request );
                 }
                 
+                retVal.persistInSession( request, response, servletContext );
+            }
+            else
+            {
                 //
-                // Store the previous PageFlowController on the nesting stack 
(if this one is nestable),
-                // or destroy the nesting stack.
+                // Going to a non-nested pageflow.  Blow away the pageflow 
stack.
                 //
-                if ( retVal.isNestable( request, servletContext ) )
+                PageFlowStack pfStack = PageFlowStack.get( request, false );
+                
+                if ( pfStack != null )
                 {
-                    //
-                    // Call create() on the newly-created page flow.
-                    //
-                    retVal.create( request, response, servletContext );
-
-                    if ( current != null )
+                    if ( _log.isDebugEnabled() )
                     {
-                        if ( _log.isDebugEnabled() )
-                        {
-                            _log.debug( "Pushing PageFlowController " + 
current + " onto the nesting stack" );
-                        }
-
-                        PageFlowStack pfStack = PageFlowStack.get( request );
-                        pfStack.push( current, request );
+                        _log.debug( "Destroying the PageFlowController stack." 
);
                     }
-                    
-                    retVal.persistInSession( request, response, servletContext 
);
-                }
-                else
-                {
+                 
                     //
-                    // Going to a non-nested pageflow.  Blow away the pageflow 
stack.
+                    // Start popping page flows until 1) there are none left 
on the stack, or 2) we find
+                    // one of the type we're returning.  If (2), we'll use 
that one (this means that executing
+                    // an action on a nesting page flow while in a nested one 
will not destroy the nesting
+                    // page flow only to create a new instance of it).
                     //
-                    PageFlowStack pfStack = PageFlowStack.get( request, false 
);
-                    
-                    if ( pfStack != null )
+                    PageFlowController onStackAlready = pfStack.popUntil( 
request, retVal.getClass() );
+
+                    if ( onStackAlready != null )
                     {
                         if ( _log.isDebugEnabled() )
                         {
-                            _log.debug( "Destroying the PageFlowController 
stack." );
+                            _log.debug( "Found a page flow of type " + 
retVal.getClass() + " in the stack; "
+                                       + "using that instance and stopping 
destruction of the nesting stack." );
                         }
-                     
-                        //
-                        // Start popping page flows until 1) there are none 
left on the stack, or 2) we find
-                        // one of the type we're returning.  If (2), we'll use 
that one (this means that executing
-                        // an action on a nesting page flow while in a nested 
one will not destroy the nesting
-                        // page flow only to create a new instance of it).
-                        //
-                        PageFlowController onStackAlready = pfStack.popUntil( 
request, retVal.getClass() );
-
-                        if ( onStackAlready != null )
-                        {
-                            if ( _log.isDebugEnabled() )
-                            {
-                                _log.debug( "Found a page flow of type " + 
retVal.getClass() + " in the stack; "
-                                           + "using that instance and stopping 
destruction of the nesting stack." );
-                            }
 
-                            retVal = onStackAlready;
-                            retVal.persistInSession( request, response, 
servletContext );
-                        }
-                        else
-                        {
-                            //
-                            // We're actually using the newly-created page 
flow, so call create() on it.
-                            // Note that we make the call to persistInSession 
*before* create, so the previous flow's
-                            // onDestroy() gets called before the new one's 
onCreate().
-                            //
-                            retVal.persistInSession( request, response, 
servletContext );
-                            retVal.create( request, response, servletContext );
-                        }
+                        retVal = onStackAlready;
+                        retVal.persistInSession( request, response, 
servletContext );
                     }
                     else
                     {
-                        retVal.persistInSession( request, response, 
servletContext );
-                        
                         //
                         // We're actually using the newly-created page flow, 
so call create() on it.
+                        // Note that we make the call to persistInSession 
*before* create, so the previous flow's
+                        // onDestroy() gets called before the new one's 
onCreate().
                         //
-                        if ( createdNew )
-                        {
-                            retVal.create( request, response, servletContext );
-                        }
+                        retVal.persistInSession( request, response, 
servletContext );
+                        retVal.create( request, response, servletContext );
                     }
                 }
-                                
-                if ( ! createdNew )
+                else
                 {
+                    retVal.persistInSession( request, response, servletContext 
);
+                    
                     //
-                    // Reinitialize transient data that may have been lost on 
session failover.
+                    // We're actually using the newly-created page flow, so 
call create() on it.
                     //
-                    current.reinitialize( request, response, servletContext );
+                    if ( createdNew )
+                    {
+                        retVal.create( request, response, servletContext );
+                    }
                 }
-                
-                return retVal;
-            }
-            catch ( InstantiationException e )
-            {
-                _log.error( "Could not instantiate PageFlowController of type 
" + jpfClass.getName(), e );
-                return null;
-            }
-            catch ( IllegalAccessException e )
-            {
-                _log.error( "Could not instantiate PageFlowController of type 
" + jpfClass.getName(), e );
-                return null;
             }
+                            
+            return retVal;
+        }
+        catch ( InstantiationException e )
+        {
+            _log.error( "Could not instantiate PageFlowController of type " + 
jpfClass.getName(), e );
+            return null;
+        }
+        catch ( IllegalAccessException e )
+        {
+            _log.error( "Could not instantiate PageFlowController of type " + 
jpfClass.getName(), e );
+            return null;
         }
     }        
     
-    
-    /**
-     * If the current session's GlobalApp is of the given class, it will be
-     * returned; otherwise, a new one will be created and the new instance
-     * will be stored as the current GlobalApp.
-     */
-    static GlobalApp getGlobalApp( Class globalAppClass, HttpServletRequest 
request,
-                                   HttpServletResponse response, 
ServletContext servletContext )
+    public static SharedFlowController getSharedFlow( Class sfClass, 
HttpServletRequest request,
+                                                      HttpServletResponse 
response, ServletContext servletContext )
     {
-        assert GlobalApp.class.isAssignableFrom( globalAppClass ) : 
globalAppClass.getName();
-        GlobalApp current = PageFlowUtils.getGlobalApp( request );
+        assert SharedFlowController.class.isAssignableFrom( sfClass ) : 
sfClass.getName();
+        
+        if ( _log.isDebugEnabled() )
+        {
+            _log.debug( "Creating SharedFlowController of type " + 
sfClass.getName() );
+        }
 
-        if ( current != null && current.getClass().equals( globalAppClass ) )
+        try
         {
+            SharedFlowController retVal = ( SharedFlowController ) 
sfClass.newInstance();
+            retVal.create( request, response, servletContext );
+            
             if ( _log.isDebugEnabled() )
             {
-                _log.debug( "Using existing instance of GlobalApp: " + current 
);
+                _log.debug( "Storing " + retVal + " in the session..." );
             }
-
-            //
-            // Reinitialize transient data that may have been lost on session 
failover.
-            //
-            current.reinitialize( request, response, servletContext );
-            return current;
+            
+            retVal.persistInSession( request, response, servletContext );
+            return retVal;
         }
-        else
+        catch ( InstantiationException e )
         {
-            if ( _log.isDebugEnabled() )
-            {
-                _log.debug( "Creating GlobalApp of type " + 
globalAppClass.getName() );
-            }
-
-            try
-            {
-                GlobalApp retVal = ( GlobalApp ) globalAppClass.newInstance();
-                retVal.create( request, response, servletContext );
-                
-                if ( _log.isDebugEnabled() )
-                {
-                    _log.debug( "Storing " + retVal + " in the session..." );
-                }
-                
-                InternalUtils.setGlobalApp( retVal, request );
-                return retVal;
-            }
-            catch ( InstantiationException e )
-            {
-                _log.error( "Could not instantiate GlobalApp of type " + 
globalAppClass.getName(), e );
-                return null;
-            }
-            catch ( IllegalAccessException e )
-            {
-                _log.error( "Could not instantiate GlobalApp of type " + 
globalAppClass.getName(), e );
-                return null;
-            }
+            _log.error( "Could not instantiate SharedFlowController of type " 
+ sfClass.getName(), e );
+            return null;
+        }
+        catch ( IllegalAccessException e )
+        {
+            _log.error( "Could not instantiate SharedFlowController of type " 
+ sfClass.getName(), e );
+            return null;
         }
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
   Fri Aug 13 23:06:05 2004
@@ -489,7 +489,6 @@
                 {
                     assert _flowController != null;  // should be set in 
initialize()
                     Field field = _flowController.getClass().getDeclaredField( 
retFormMember );
-                    assert ActionForm.class.isAssignableFrom( field.getType() 
) : field.getType();
                     returnFormClass = field.getType();
                     field.setAccessible( true );
                     ActionForm form = InternalUtils.wrapFormBean( field.get( 
_flowController ) );

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
    Fri Aug 13 23:06:05 2004
@@ -115,46 +115,10 @@
                 
                 fwd = doReturnToPage( request, prevPageInfo, curJpf, form, 
actionName, pageFlowFwd, flowController );
                 
-                if ( fwd != null )
-                {
-                    //
-                    // If the new (return-to) Forward specifies a redirect 
value explicitly, use that; otherwise
-                    // use the redirect value from the original Forward.
-                    //
-                    if ( pageFlowFwd.hasExplicitRedirectValue() )
-                    {
-                        fwd.setRedirect( pageFlowFwd.getRedirect() );
-                    }
-                    
-                    //
-                    // If there's a query string, override the previous query 
string.
-                    //
-                    String fwdPath = fwd.getPath();
-                    String newQueryString = pageFlowFwd.getQueryString();
-                    
-                    if ( newQueryString != null )
-                    {
-                        int existingQuery = fwdPath.indexOf( '?' );
-                        
-                        if ( existingQuery != -1 )
-                        {
-                            fwd.setPath( fwdPath.substring( 0, existingQuery ) 
+ newQueryString );
-                        }
-                        else
-                        {
-                            fwd.setPath( fwdPath + newQueryString );
-                        }
-                    }
-                }
-                
                 if ( prevPageInfo != null )
                 {
                     mapping = prevPageInfo.getMapping();
-                    
-                    if ( form == null )
-                    {
-                        form = prevPageInfo.getForm();
-                    }
+                    if ( form == null ) form = prevPageInfo.getForm();
                 }
                 
                 if ( _log.isDebugEnabled() )
@@ -174,111 +138,7 @@
             if ( pageFlowFwd.shouldPopPageFlow() )
             {
                 isSpecialForward = true;
-                
-                PageFlowStack pfStack = PageFlowStack.get( request );
-                String exitAction = pageFlowFwd.getPath();
-                
-                if ( pfStack.isEmpty() )
-                {
-                    PageFlowController curJpf = 
InternalUtils.getCurrentPageFlow( request, false );
-                    
-                    if ( _log.isInfoEnabled() )
-                    {
-                        _log.info( "Tried to pop from empty PageFlow stack.  
Current = "
-                                   + curJpf.getClass().getName() );
-                    }
-                    
-                    if ( _log.isWarnEnabled() )
-                    {
-                        StringBuffer msg = new StringBuffer( "Tried to pop 
from empty PageFlow stack." );
-                        msg.append( "  Current page flow is " );
-                        msg.append( curJpf != null ? 
curJpf.getClass().getName() : null );
-                        _log.warn( msg.append( '.' ).toString() );
-                    }
-                    
-                    throw new EmptyNestingStackException( exitAction, curJpf );
-                }
-                
-                PageFlowStack.PushedPageFlow pushedPageFlowWrapper = 
pfStack.pop( request );
-                PageFlowController poppedPageFlow = 
pushedPageFlowWrapper.getPageFlow();
-
-                if ( _log.isDebugEnabled() )
-                {
-                    _log.debug( "Popped PageFlowController " + poppedPageFlow 
+ " from the nesting stack" );
-                }
-
-                InternalUtils.setCurrentPageFlow( poppedPageFlow, request );
-
-                
-                //
-                // If an ActionInterceptor forwarded to the nested page flow, 
give it a chance to
-                // determine the URI as the nested flow is returning.
-                //
-                ActionInterceptor interceptor = 
pushedPageFlowWrapper.getInterceptor();
-                
-                if ( interceptor != null )
-                {
-                    InterceptorForward interceptorForward = null;
-                    
-                    try
-                    {
-                        interceptorForward = interceptor.doPostIntercept( 
request, response, poppedPageFlow,
-                                                                          
pushedPageFlowWrapper.getInterceptedForward(),
-                                                                          
exitAction );
-                    }
-                    catch ( Exception e )
-                    {
-                        _log.error( "Exception in " + 
interceptor.getClass().getName() + ".doPostIntercept", e );
-                    }
-                    
-                    if ( interceptorForward != null )
-                    {
-                        if ( _log.isDebugEnabled() )
-                        {
-                            _log.debug( "post-intercept: forwarding to " + 
interceptorForward.getPath() );
-                        }
-                        
-                        interceptorForward.rehydrateRequest( request );
-                        ActionInterceptorChain.setIsReturningFromIntercept( 
request, true );
-                        return interceptorForward;
-                    }
-                }
-
-                //
-                // Raise the returned action on the popped pageflow.
-                //                    
-                assert exitAction.charAt( 0 ) != '/' : exitAction;
-
-                if ( _log.isDebugEnabled() )
-                {
-                    _log.debug( "Action on popped PageFlowController is " + 
exitAction );
-                }
-
-                StringBuffer exitActionPath = new StringBuffer( 
poppedPageFlow.getModulePath() );
-                if ( exitAction.charAt( 0 ) != '/' )
-                {
-                    exitActionPath.append( '/' );
-                }
-                exitActionPath.append( exitAction ).append( ACTION_EXTENSION );
-
-                //
-                // Forward out of this PageFlowController.
-                //
-                fwd = new ActionForward( exitActionPath.toString(), false );
-                fwd.setContextRelative( true );
-                
-                //
-                // Store the returned form in the request.
-                //
-                ActionForm retForm = pageFlowFwd.getFirstOutputForm( mapping, 
request );
-                
-                if ( retForm != null )
-                {
-                    request.setAttribute( RETURNING_FORM_ATTR_NAME, retForm );
-                }
-                
-                // @TODO 9.0 - delete this deprecated feature (following line)
-                request.setAttribute( RETURNING_FROM_NESTING_ATTR_NAME, 
Boolean.TRUE );
+                fwd = doNestingReturn( pageFlowFwd, request, response, mapping 
);
             }
 
             //
@@ -328,75 +188,106 @@
                                                  PageFlowController 
currentPageFlow, ActionForm currentForm,
                                                  String actionName, Forward 
pageFlowFwd, FlowController flowController )
     {
+        if ( prevPageInfo == null )
+        {
+            if ( _log.isInfoEnabled() )
+            {
+                _log.info( "Attempted return-to-page, but previous page info 
was missing." );
+            }
+        
+            throw new NoPreviousPageException( actionName, pageFlowFwd, 
currentPageFlow );
+        }
+        
         //
-        // Figure out what URI to return to, and set the original form in the 
request
-        // or session.
+        // Figure out what URI to return to, and set the original form in the 
request or session.
         //        
-        if ( prevPageInfo != null )
+        ActionForward retFwd = prevPageInfo.getForward();
+        
+        //
+        // Restore any forms that are specified by this Forward (overwrite the 
original forms).
+        //
+        if ( retFwd instanceof Forward )
         {
-            ActionForward retFwd = prevPageInfo.getForward();
+            PageFlowUtils.setOutputForms( prevPageInfo.getMapping(),
+                                          ( Forward ) retFwd, request, false );
             
-            //
-            // Restore any forms that are specified by this Forward (overwrite 
the original forms).
-            //
-            if ( retFwd instanceof Forward )
-            {
-                PageFlowUtils.setOutputForms( prevPageInfo.getMapping(),
-                                              ( Forward ) retFwd, request, 
false );
-                
-                InternalUtils.addActionOutputs( ( ( Forward ) retFwd 
).getActionOutputs(), request, false );
-            }
+            InternalUtils.addActionOutputs( ( ( Forward ) retFwd 
).getActionOutputs(), request, false );
+        }
+        
+        //
+        // If the currently-posted form is of the right type, initialize the 
page with
+        // that (but we won't overwrite the form that was set above).
+        //
+        if ( currentForm != null )
+        {
+            PageFlowUtils.setOutputForm( prevPageInfo.getMapping(), 
currentForm, request, false );
+        }
+        
+        //
+        // Initialize the page with the original form it got forwarded (but we 
won't overwrite the form
+        // that was set above).
+        //
+        if ( prevPageInfo.getMapping() != null )
+        {
+            InternalUtils.setFormInScope( prevPageInfo.getMapping().getName(),
+                                          prevPageInfo.getForm(),
+                                          prevPageInfo.getMapping(), request, 
false );
+        }
             
+        //
+        // If we're forwarding to a page in a different pageflow, we need to 
make sure
+        // the returned ActionForward has the right module path, and that it 
has
+        // contextRelative=true.
+        //
+        if ( ! retFwd.getContextRelative() && flowController != 
currentPageFlow )
+        {
+
+            retFwd = new ActionForward( retFwd.getName(),
+                                        currentPageFlow.getModulePath() + 
retFwd.getPath(),
+                                        retFwd.getRedirect(),
+                                        true );
+
+        }
+        
+        if ( _log.isDebugEnabled() )
+        {
+            _log.debug( "Return-to-page in PageFlowController " + 
flowController.getClass().getName()
+                       + ": original URI " + retFwd.getPath() );
+        }
+        
+        if ( retFwd != null )
+        {
             //
-            // If the currently-posted form is of the right type, initialize 
the page with
-            // that (but we won't overwrite the form that was set above).
+            // If the new (return-to) Forward specifies a redirect value 
explicitly, use that; otherwise
+            // use the redirect value from the original Forward.
             //
-            if ( currentForm != null )
+            if ( pageFlowFwd.hasExplicitRedirectValue() )
             {
-                PageFlowUtils.setOutputForm( prevPageInfo.getMapping(), 
currentForm, request, false );
+                retFwd.setRedirect( pageFlowFwd.getRedirect() );
             }
             
             //
-            // Initialize the page with the original form it got forwarded 
(but we won't overwrite the form
-            // that was set above).
-            //
-            if ( prevPageInfo.getMapping() != null )
-            {
-                InternalUtils.setFormInScope( 
prevPageInfo.getMapping().getName(),
-                                              prevPageInfo.getForm(),
-                                              prevPageInfo.getMapping(), 
request, false );
-            }
-                
-            //
-            // If we're forwarding to a page in a different pageflow, we need 
to make sure
-            // the returned ActionForward has the right module path, and that 
it has
-            // contextRelative=true.
+            // If there's a query string, override the previous query string.
             //
-            if ( ! retFwd.getContextRelative() && flowController != 
currentPageFlow )
-            {
-
-                retFwd = new ActionForward( retFwd.getName(),
-                                            currentPageFlow.getModulePath() + 
retFwd.getPath(),
-                                            retFwd.getRedirect(),
-                                            true );
-
-            }
+            String fwdPath = retFwd.getPath();
+            String newQueryString = pageFlowFwd.getQueryString();
             
-            if ( _log.isDebugEnabled() )
+            if ( newQueryString != null )
             {
-                _log.debug( "Return-to-page in PageFlowController " + 
flowController.getClass().getName()
-                           + ": original URI " + retFwd.getPath() );
+                int existingQuery = fwdPath.indexOf( '?' );
+                
+                if ( existingQuery != -1 )
+                {
+                    retFwd.setPath( fwdPath.substring( 0, existingQuery ) + 
newQueryString );
+                }
+                else
+                {
+                    retFwd.setPath( fwdPath + newQueryString );
+                }
             }
-            
-            return retFwd;
-        }
-        
-        if ( _log.isInfoEnabled() )
-        {
-            _log.info( "Attempted return-to-page, but previous page info was 
missing." );
         }
         
-        throw new NoPreviousPageException( actionName, pageFlowFwd, 
currentPageFlow );
+        return retFwd;
     }
     
     private static ActionForward doReturnToAction( HttpServletRequest request, 
String actionName, Forward pageFlowFwd,
@@ -478,4 +369,113 @@
                           servletContext, flowController );
     }
     
+    private static ActionForward doNestingReturn( Forward pageFlowFwd, 
HttpServletRequest request,
+                                                  HttpServletResponse 
response, ActionMapping mapping )
+    {
+        PageFlowStack pfStack = PageFlowStack.get( request );
+        String exitAction = pageFlowFwd.getPath();
+                
+        if ( pfStack.isEmpty() )
+        {
+            PageFlowController curJpf = InternalUtils.getCurrentPageFlow( 
request, false );
+                    
+            if ( _log.isInfoEnabled() )
+            {
+                _log.info( "Tried to pop from empty PageFlow stack.  Current = 
"
+                           + curJpf.getClass().getName() );
+            }
+                    
+            if ( _log.isWarnEnabled() )
+            {
+                StringBuffer msg = new StringBuffer( "Tried to pop from empty 
PageFlow stack." );
+                msg.append( "  Current page flow is " );
+                msg.append( curJpf != null ? curJpf.getClass().getName() : 
null );
+                _log.warn( msg.append( '.' ).toString() );
+            }
+                    
+            throw new EmptyNestingStackException( exitAction, curJpf );
+        }
+                
+        PageFlowStack.PushedPageFlow pushedPageFlowWrapper = pfStack.pop( 
request );
+        PageFlowController poppedPageFlow = 
pushedPageFlowWrapper.getPageFlow();
+
+        if ( _log.isDebugEnabled() )
+        {
+            _log.debug( "Popped PageFlowController " + poppedPageFlow + " from 
the nesting stack" );
+        }
+
+        InternalUtils.setCurrentPageFlow( poppedPageFlow, request );
+
+                
+        //
+        // If an ActionInterceptor forwarded to the nested page flow, give it 
a chance to
+        // determine the URI as the nested flow is returning.
+        //
+        ActionInterceptor interceptor = pushedPageFlowWrapper.getInterceptor();
+                
+        if ( interceptor != null )
+        {
+            InterceptorForward interceptorForward = null;
+                    
+            try
+            {
+                interceptorForward = interceptor.doPostIntercept( request, 
response, poppedPageFlow,
+                                                                  
pushedPageFlowWrapper.getInterceptedForward(),
+                                                                  exitAction );
+            }
+            catch ( Exception e )
+            {
+                _log.error( "Exception in " + interceptor.getClass().getName() 
+ ".doPostIntercept", e );
+            }
+                    
+            if ( interceptorForward != null )
+            {
+                if ( _log.isDebugEnabled() )
+                {
+                    _log.debug( "post-intercept: forwarding to " + 
interceptorForward.getPath() );
+                }
+                        
+                interceptorForward.rehydrateRequest( request );
+                ActionInterceptorChain.setIsReturningFromIntercept( request, 
true );
+                return interceptorForward;
+            }
+        }
+
+        //
+        // Raise the returned action on the popped pageflow.
+        //                    
+        assert exitAction.charAt( 0 ) != '/' : exitAction;
+
+        if ( _log.isDebugEnabled() )
+        {
+            _log.debug( "Action on popped PageFlowController is " + exitAction 
);
+        }
+
+        StringBuffer exitActionPath = new StringBuffer( 
poppedPageFlow.getModulePath() );
+        if ( exitAction.charAt( 0 ) != '/' )
+        {
+            exitActionPath.append( '/' );
+        }
+        exitActionPath.append( exitAction ).append( ACTION_EXTENSION );
+
+        //
+        // Store the returned form in the request.
+        //
+        ActionForm retForm = pageFlowFwd.getFirstOutputForm( mapping, request 
);
+                
+        if ( retForm != null )
+        {
+            request.setAttribute( RETURNING_FORM_ATTR_NAME, retForm );
+        }
+                
+        // @TODO 9.0 - delete this deprecated feature (following line)
+        request.setAttribute( RETURNING_FROM_NESTING_ATTR_NAME, Boolean.TRUE );
+        
+        //
+        // Forward to the rerturn-action on the nestig page flow.
+        //
+        ActionForward fwd = new ActionForward( exitActionPath.toString(), 
false );
+        fwd.setContextRelative( true );
+        return fwd;
+    }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
 Fri Aug 13 23:06:05 2004
@@ -18,15 +18,12 @@
  */
 package org.apache.beehive.netui.pageflow;
 
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionMapping;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.ServletContext;
 
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
 
 
 /**
@@ -46,52 +43,10 @@
  * @see PageFlowController
  */
 public class GlobalApp
-        extends FlowController
-        implements PageFlowConstants
+        extends SharedFlowController
 {
     /**
-     * Get the Struts module path for Global.app.
-     * 
-     * @return "/-global".
-     */ 
-    
-    public String getModulePath()
-    {
-        return GLOBALAPP_MODULE_CONTEXT_PATH;
-    }
-    
-    void persistInSession( HttpServletRequest request, HttpServletResponse 
response,
-                           ServletContext servletContext )
-    {
-        InternalUtils.setGlobalApp( this, request );
-    }
-    
-    /**
-     * @exclude
-     */ 
-    public void reInit( ServletContext servletContext )
-    {
-        if ( getServlet() == null )
-        {
-            setServlet( InternalUtils.getActionServlet( servletContext ) );    
        
-        }
-    }
-
-    /**
-     * Ensures that any changes to this FlowController will be replicated in a 
cluster (for failover),
-     * even if the replication scheme uses a change-detection algorithm that 
relies on
-     * HttpSession.setAttribute to be aware of changes.
-     * 
-     * @param request the current HttpServletRequest
-     */
-    public void ensureFailover( HttpServletRequest request )
-    {
-        InternalUtils.getServerAdapter().ensureFailover( 
PageFlowUtils.GLOBALAPP_ATTR, this, request );
-    }
-
-    /**
      * Get the URI for the webapp.
-     * @exclude
      * @return "/".
      */
     public String getURI()
@@ -104,44 +59,8 @@
         return GLOBALAPP_SOURCEFILE_NAME;
     }
     
-    PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, 
HttpServletRequest request )
-    {
-        assert curJpf != null;
-        return curJpf.getCurrentPageInfo();        
-    }
-    
-    /**
-     * Called from [EMAIL PROTECTED] FlowController#forwardTo}.
-     */ 
-    void savePreviousPageInfo( ActionForward forward, ActionForm form, 
ActionMapping mapping,
-                               HttpServletRequest request, ServletContext 
servletContext,
-                               boolean isSpecialForward )
-    {
-        //
-        // Special case: if the given forward has a path to a page in the 
current pageflow,
-        // let that pageflow save the info on this page.  Otherwise, don't 
ever save any
-        // info on what we're forwarding to.
-        //
-        if ( ! isSpecialForward && forward != null )   // i.e., if it's a 
straight Forward to a path, not a return-to="...", etc.
-        {
-            PageFlowController currentJpf = PageFlowUtils.getCurrentPageFlow( 
request );
-            
-            if ( currentJpf != null )
-            {
-                if ( forward.getContextRelative() && 
forward.getPath().startsWith( currentJpf.getModulePath() ) )
-                {
-                    currentJpf.savePreviousPageInfo( forward, form, mapping, 
request, servletContext,
-                                                     isSpecialForward );
-                }
-            }
-        }
-    }
-    
-    /**
-     * Remove this instance from the session.
-     */ 
-    protected void delete()
+    void setImplicitObject( HttpServletRequest request )
     {
-        InternalUtils.deleteGlobalApp( getRequest() );
+        request.setAttribute( 
InternalConstants.GLOBAL_APP_IMPLICIT_OBJECT_NAME, this );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
 Fri Aug 13 23:06:05 2004
@@ -87,14 +87,14 @@
     public static final int DEFAULT_NESTING_OVERFLOW_COUNT = 25;
 
     /**
-     * Servlet context-param that configures a HttpRedirector-derived class to 
instantiate to handle
-     * forwards and redirects.
+     * Servlet context-param that configures a [EMAIL PROTECTED] 
org.apache.beehive.netui.pageflow.handler.ForwardRedirectHandler}-
+     * derived class to instantiate to handle forwards and redirects.
      */ 
     public static final String HTTP_REDIRECTOR_PARAM = "jpf-http-redirector";
     
     /**
-     * Servlet context-param that configures a [EMAIL PROTECTED] 
org.apache.beehive.netui.pageflow.handler.LoginHandler}-derived class to 
instantiate to handle
-     * user logins.
+     * Servlet context-param that configures a [EMAIL PROTECTED] 
org.apache.beehive.netui.pageflow.handler.LoginHandler}-derived
+     * class to instantiate to handle user logins.
      */ 
     public static final String LOGIN_HANDLER_PARAM = "jpf-login-handler";
     
@@ -114,7 +114,7 @@
     static final String RETURNING_FROM_NESTING_ATTR_NAME = 
FlowController.class.getName() + "_nestedReturning";
     static final String CURRENT_JPF_ATTR = PageFlowUtils.class.getName() + 
"_currentPageFlow";
     static final String CURRENT_SINGLETON_ATTR = PageFlowUtils.class.getName() 
+ "_currentSingletonModule";
-    static final String GLOBALAPP_ATTR = PageFlowUtils.class.getName() + 
"_globalApp";
+    static final String SHARED_FLOW_ATTR_PREFIX = 
PageFlowUtils.class.getName() + "_sharedFlow:";
 
     /**
      * The webapp-relative directory for Struts module configuration files 
generated by the

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
        Fri Aug 13 23:06:05 2004
@@ -35,6 +35,7 @@
 import org.apache.beehive.netui.pageflow.config.PageFlowControllerConfig;
 import org.apache.beehive.netui.pageflow.internal.CachedPageFlowInfo;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
 import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
 
 
@@ -50,13 +51,13 @@
  * user interaction with JSP files.  The actions are handled by <i>action 
methods</i> that
  * perform arbitrary logic and determine the next URI to be displayed.
  * <p>
- * Actions that are not handled by the current PageFlowController "bubble" up 
to the current
- * [EMAIL PROTECTED] GlobalApp} instance.
+ * Actions that are not handled by the current PageFlowController "bubble" up 
to the appropriate
+ * [EMAIL PROTECTED] SharedFlowController} instance.
  * <p>
  * Data in the current PageFlowController instance can be accessed by 
databinding tags using the
  * <code>pageFlow</code> scope.
  * 
- * @see GlobalApp
+ * @see SharedFlowController
  */
 public abstract class PageFlowController
         extends FlowController
@@ -238,46 +239,61 @@
                                              HttpServletResponse response )
         throws Exception
     {
-        initializeGlobalAppField( request, response, 
getServlet().getServletContext() );
+        initializeSharedFlowField( request, response, 
getServlet().getServletContext() );
         return super.internalExecute( mapping, form, request, response );
     }
     
-    private void initializeGlobalAppField( HttpServletRequest request, 
HttpServletResponse response, 
+    private void initializeSharedFlowField( HttpServletRequest request, 
HttpServletResponse response, 
                                            ServletContext servletContext )
     {
         //
-        // Initialize the globalApp field.
+        // Initialize the SharedFlowController field.
         //
-        Field globalAppMemberField = getCachedInfo().getGlobalAppMemberField();
+        Field sharedFlowMemberField = 
getCachedInfo().getSharedFlowMemberField();
         
         try
         {
-            if ( globalAppMemberField != null && globalAppMemberField.get( 
this ) == null )
+            if ( sharedFlowMemberField != null && sharedFlowMemberField.get( 
this ) == null )
             {
-                GlobalApp ga = InternalUtils.ensureGlobalApp( request, 
response, servletContext );
+                SharedFlowController sf = InternalUtils.getSharedFlow( this, 
request, response, servletContext );
                 
-                if ( _log.isDebugEnabled() )
+                if ( sf != null )
                 {
-                    _log.debug( "Found field " + GLOBALAPP_MEMBER_NAME + " in 
" + this
-                                + ". Initializing with GlobalApp " + ga );
+                    if ( _log.isTraceEnabled() )
+                    {
+                        _log.trace( "Initializing field " + 
sharedFlowMemberField.getName() + " in " + this
+                                    + " with SharedFlowController " + sf );
+                    }
+                    
+                    try
+                    {
+                        sharedFlowMemberField.set( this, sf );
+                    }
+                    catch ( IllegalArgumentException e )
+                    {
+                        _log.error( "Could not set field " + 
sharedFlowMemberField.getName() + " on "
+                                    + getDisplayName() + "; 
SharedFlowController is of type "
+                                    + sf.getClass().getName() + ", field type 
is "
+                                    + 
sharedFlowMemberField.getType().getName() );
+                    }
                 }
-                
-                globalAppMemberField.set( this, ga );
             }
         }
         catch ( IllegalAccessException e )
         {
-            if ( _log.isErrorEnabled() )
-            {
-                _log.error( "Error initializing GlobalApp field " + 
GLOBALAPP_MEMBER_NAME, e );
-            }
+            _log.error( "Error initializing SharedFlowController field " + 
sharedFlowMemberField.getName(), e );
         }
     }
     
+    protected SharedFlowController getSharedFlow()
+    {
+        return InternalUtils.getSharedFlow( this, getRequest(), getResponse(), 
getServletContext() );
+    }
+    
     final synchronized void create( HttpServletRequest request, 
HttpServletResponse response,
                                     ServletContext servletContext )
     {
-        initializeGlobalAppField( request, response, servletContext );
+        initializeSharedFlowField( request, response, servletContext );
         super.create( request, response, servletContext );
     }
     
@@ -559,22 +575,20 @@
         //
         // If previous-action is disabled (unused in this pageflow), just 
return.
         //
-        ControllerConfig cc = mapping.getModuleConfig().getControllerConfig(); 
      
+        ModuleConfig mc = getModuleConfig();
+        ControllerConfig cc = mc.getControllerConfig();       
         if ( cc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) cc ).isReturnToActionDisabled() )
         {
             //
-            // Make sure previous-action is disabled in Global.app, too; if 
not, we can't do it.
+            // Make sure previous-action is disabled in the 
SharedFlowController too; if not, we can't do it.
             //
-            ModuleConfig globalAppModuleConfig = 
InternalUtils.getGlobalAppConfig( servletContext );
-            ControllerConfig gc = ( globalAppModuleConfig != null ? 
globalAppModuleConfig.getControllerConfig() : null );
+            ModuleConfig sharedFlowConfig = InternalUtils.getSharedFlowConfig( 
mc, servletContext );
+            ControllerConfig sc = ( sharedFlowConfig != null ? 
sharedFlowConfig.getControllerConfig() : null );
             
-            if ( gc == null ||
-                    ( gc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) gc ).isReturnToActionDisabled() ) )
+            if ( sc == null ||
+                ( sc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) sc ).isReturnToActionDisabled() ) )
             {
-                if ( ! alwaysTrackPreviousAction() )
-                {
-                    return;
-                }
+                if ( ! alwaysTrackPreviousAction() ) return;
             }
         }
         
@@ -592,22 +606,20 @@
         //
         // If previous-page is disabled (unused in this pageflow), just return.
         //
-        ControllerConfig cc = getModuleConfig( servletContext, request 
).getControllerConfig();       
+        ModuleConfig mc = getModuleConfig();
+        ControllerConfig cc = mc.getControllerConfig();       
         if ( cc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) cc ).isReturnToPageDisabled() )
         {
             //
-            // Make sure previous-page is disabled in Global.app, too; if not, 
we can't do it.
+            // Make sure previous-page is disabled in the 
SharedFlowController, too; if not, we can't do it.
             //
-            ModuleConfig globalAppModuleConfig = 
InternalUtils.getGlobalAppConfig( servletContext );
-            ControllerConfig gc = ( globalAppModuleConfig != null ? 
globalAppModuleConfig.getControllerConfig() : null );
+            ModuleConfig sharedFlowConfig = InternalUtils.getSharedFlowConfig( 
mc, servletContext );
+            ControllerConfig sc = ( sharedFlowConfig != null ? 
sharedFlowConfig.getControllerConfig() : null );
             
-            if ( gc == null ||
-                 ( gc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) gc ).isReturnToPageDisabled() ) )
+            if ( sc == null ||
+                 ( sc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) sc ).isReturnToPageDisabled() ) )
             {
-                if ( ! alwaysTrackPreviousPage() )
-                {
-                    return;
-                }
+                if ( ! alwaysTrackPreviousPage() ) return;
             }
         }
         
@@ -722,8 +734,7 @@
                 }
                 
                 // This will cause the right pageflow stack stuff to happen.
-                FlowControllerFactory.getPageFlow( getClass(), request, 
response,
-                                                   
getServlet().getServletContext(), false );
+                FlowControllerFactory.getPageFlow( getClass(), request, 
response, getServlet().getServletContext() );
             }
         }
         
@@ -750,5 +761,10 @@
         }
         
         return info;
+    }
+
+    void setImplicitObject( HttpServletRequest request )
+    {
+        request.setAttribute( 
InternalConstants.PAGE_FLOW_IMPLICIT_OBJECT_NAME, this );
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowJspFilter.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowJspFilter.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowJspFilter.java
 Fri Aug 13 23:06:05 2004
@@ -33,7 +33,6 @@
 import org.apache.struts.action.ActionServlet;
 import org.apache.struts.config.ModuleConfig;
 
-import org.apache.beehive.netui.script.ExpressionEvaluatorFactory;
 import org.apache.beehive.netui.script.common.BundleMap;
 import org.apache.beehive.netui.util.logging.Logger;
 import org.apache.beehive.netui.util.FileUtils;
@@ -156,8 +155,8 @@
                 //
                 // Make sure that the current PageFlowController is set up for 
this request.
                 //
-                PageFlowController curJpf =
-                    InternalUtils.ensureCurrentPageFlow( httpRequest, 
httpResponse, _servletContext );
+                PageFlowController curJpf = 
+                        FlowControllerFactory.getPageFlowForRequest( 
httpRequest, httpResponse, _servletContext );
                 
                 //
                 // If there is no pageflow for the current Struts module, than 
fall back to default
@@ -184,7 +183,7 @@
                 {
                     //
                     // We're going to bail out if there are too many 
concurrent requests for the same JPF.
-                    // This prevents an attack that takes advantage of the 
fact that we serialize requests
+                    // This prevents an attack that takes advantage of the 
fact that we synchronize requests
                     // to the same pageflow.
                     //
                     if ( curJpf.incrementRequestCount( httpRequest, 
httpResponse, _servletContext ) )
@@ -202,20 +201,10 @@
                                         new FlowController.PerRequestState( 
httpRequest, httpResponse, null );
                                 FlowController.PerRequestState prevState = 
curJpf.setPerRequestState( newState );
                                 curJpf.setServlet( 
InternalUtils.getActionServlet( _servletContext ) );
-
+                                setImplicitObjects( httpRequest, httpResponse, 
curJpf );
+                                
                                 try
                                 {
-                                    // @todo: need to wrap this in checks for 
JSP 1.2
-                                    // @todo: feature: need to add support for 
chaining in user-code to
-                                    //        run when setting implicit 
objects on the request
-                                    httpRequest.setAttribute("pageFlow", 
curJpf);
-                                    httpRequest.setAttribute("pageInput", 
InternalUtils.getActionOutputMap(httpRequest, false));
-                                    InternalUtils.ensureGlobalApp(httpRequest, 
httpResponse);
-                                    httpRequest.setAttribute("globalApp", 
PageFlowUtils.getGlobalApp(httpRequest));
-                                    BundleMap bundleMap = new 
BundleMap(httpRequest, _servletContext, null);
-                                    httpRequest.setAttribute("bundle", 
bundleMap);
-
-                                    InternalUtils.setFacesBackingBean( 
httpRequest, _servletContext );
                                     chain.doFilter( request, response );
                                 }
                                 finally
@@ -232,14 +221,7 @@
                 }
                 else
                 {
-                    // @todo: need to wrap this in checks for JSP 1.2
-                    // @todo: feature: need to add support for chaining in 
user-code to
-                    //        run when setting implicit objects on the request
-                    InternalUtils.ensureGlobalApp(httpRequest, httpResponse);
-                    httpRequest.setAttribute("globalApp", 
PageFlowUtils.getGlobalApp(httpRequest));
-                    BundleMap bundleMap = new BundleMap(httpRequest, 
_servletContext, null);
-                    httpRequest.setAttribute("bundle", bundleMap);
-
+                    setImplicitObjects( httpRequest, httpResponse, null );
                     chain.doFilter( request, response );
                 }
             }
@@ -262,6 +244,24 @@
         }
     }
     
+    private void setImplicitObjects( HttpServletRequest request, 
HttpServletResponse response,
+                                     PageFlowController curJpf )
+    {
+        // @todo: need to wrap this in checks for JSP 1.2
+        // @todo: feature: need to add support for chaining in user-code to
+        //        run when setting implicit objects on the request
+        if ( curJpf != null )
+        {
+            curJpf.setImplicitObject( request );
+            InternalUtils.setFacesBackingBean( request, _servletContext );
+            request.setAttribute( "pageInput", 
InternalUtils.getActionOutputMap( request, false ) );
+        }
+        
+        SharedFlowController sf = 
FlowControllerFactory.getSharedFlowForRequest( request, response, 
_servletContext );
+        if ( sf != null ) sf.setImplicitObject( request );
+        BundleMap bundleMap = new BundleMap( request, _servletContext, null );
+        request.setAttribute( "bundle", bundleMap );
+    }
     /**
      * Make sure that when this JSP is rendered, it will set headers in the 
response to prevent caching.
      * Because these headers are lost on server forwards, we set a request 
attribute to cause the headers

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
  (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
  Fri Aug 13 23:06:05 2004
@@ -80,10 +80,9 @@
 
     private static final Logger _log = Logger.getInstance( 
PageFlowRequestProcessor.class );
     
-    private static final String PREFIX = 
PageFlowRequestProcessor.class.getName() + ":";
+    private static final String PREFIX = 
PageFlowRequestProcessor.class.getName() + ':';
     private static final String ACTION_OVERRIDE_PARAM_PREFIX = 
"actionOverride:";
     private static final int    ACTION_OVERRIDE_PARAM_PREFIX_LEN = 
ACTION_OVERRIDE_PARAM_PREFIX.length();
-    private static final String ATTEMPTED_GLOBALAPP_INIT_ATTR = PREFIX + 
"attemptedGlobalAppInit";
     private static final String SCHEME_UNSECURE = "http";
     private static final String SCHEME_SECURE = "https";
     private static final String REDIRECT_REQUEST_ATTRS_PREFIX = PREFIX + 
"requestAttrs:";
@@ -124,8 +123,8 @@
                 if ( FlowController.class.isAssignableFrom( jpfActionClass ) )
                 {
                     FlowController fc =
-                        FlowControllerFactory.getFlowController( 
jpfActionClass, request, response, servletContext );
-                    fc.setServlet( this.servlet );
+                        InternalUtils.getFlowController( jpfActionClass, 
request, response, servletContext );
+                    fc.setServlet( servlet );
                     return fc;
                 }
                 else
@@ -162,10 +161,7 @@
         String name = mapping.getName();
 
         assert name != null : mapping.getPath();
-        if ( name == null )
-        {
-            return null;
-        }
+        if ( name == null ) return null;
 
         FormBeanConfig config = moduleConfig.findFormBeanConfig( name );
         ActionForm instance;
@@ -183,7 +179,7 @@
                 
                 if ( _log.isDebugEnabled() )
                 {
-                    _log.debug( " Creating new DynaActionForm instance " + "of 
type '" + config.getType() + "'" );
+                    _log.debug( " Creating new DynaActionForm instance " + "of 
type '" + config.getType() + '\'' );
                 }
             }
             catch ( Exception e )
@@ -373,7 +369,7 @@
         // struts does this
         if ( form != null )
         {
-            form.setServlet( this.servlet );
+            form.setServlet( servlet );
             form.reset( mapping, request );
         }
 
@@ -470,7 +466,7 @@
                 if ( _log.isDebugEnabled() )
                 {
                     _log.debug( "checkSecurity() caused a redirect.  Ending 
processing for this request "
-                               + "(" + uri + ")" );
+                               + '(' + uri + ')' );
                 }
 
                 // @TODO when in portal, we'll need to set some sort of flag 
to notify that the request
@@ -511,18 +507,14 @@
         }
 
         //
-        // First create Global.app if it doesn't exist, and if we haven't 
already tried.
+        // First create the appropriate SharedFlowController if it doesn't 
exist.
         //
-        if ( request.getSession().getAttribute( ATTEMPTED_GLOBALAPP_INIT_ATTR 
) == null )
+        if ( _log.isInfoEnabled() )
         {
-            if ( _log.isInfoEnabled() )
-            {
-                _log.info( "Attempting to instantiate Global.app." );
-            }
-
-            request.getSession().setAttribute( ATTEMPTED_GLOBALAPP_INIT_ATTR, 
Boolean.TRUE );
-            InternalUtils.ensureGlobalApp( request, response, servletContext );
+            _log.info( "Attempting to instantiate a SharedFlowController for 
request " + request.getRequestURI() );
         }
+        
+        FlowControllerFactory.getSharedFlowForRequest( request,  response, 
getServletContext() );
 
         //
         // Some of our tags can override the Action through a 
request-parameter.  If this
@@ -554,8 +546,7 @@
 
                     if ( _log.isDebugEnabled() )
                     {
-                        _log.debug( "A request parameter overrode the action.  
Forwarding to: "
-                                    + actionPath );
+                        _log.debug( "A request parameter overrode the action.  
Forwarding to: " + actionPath );
                     }
 
                     ForwardRedirectHandler handler = ContextCache.get( 
servletContext ).getForwardRedirectHandler();
@@ -642,15 +633,15 @@
      */ 
     private static class RehydratedMultipartRequestWrapper extends 
MultipartRequestWrapper
     {
-        public RehydratedMultipartRequestWrapper( HttpServletRequest request )
+        public RehydratedMultipartRequestWrapper( HttpServletRequest req )
         {
-            super( request );
+            super( req );
              
-            MultipartRequestHandler handler = 
MultipartRequestUtils.getCachedMultipartHandler( request );
+            MultipartRequestHandler handler = 
MultipartRequestUtils.getCachedMultipartHandler( req );
              
             if ( handler != null )
             {
-                ScopedRequest scopedRequest = 
ScopedServletUtils.unwrapRequest( request );
+                ScopedRequest scopedRequest = 
ScopedServletUtils.unwrapRequest( req );
                 Map textElements = handler.getTextElements();
                 parameters = scopedRequest != null ? 
scopedRequest.filterParameterMap( textElements ) : textElements;
             }
@@ -766,7 +757,7 @@
         return ( ActionMapping ) moduleConfig.findActionConfig( 
BEGIN_ACTION_PATH );
     }
     
-    private String makeRedirectedRequestAttrsKey( String webappRelativeURI, 
String hash )
+    private static String makeRedirectedRequestAttrsKey( String 
webappRelativeURI, String hash )
     {
         return REDIRECT_REQUEST_ATTRS_PREFIX + hash + webappRelativeURI;
     }
@@ -786,19 +777,18 @@
     
     /**
      * Used by [EMAIL PROTECTED] PageFlowRequestProcessor#processMapping}.  
Its main job is to return
-     * [EMAIL PROTECTED] GlobalAppForwardAction} as the type.
+     * [EMAIL PROTECTED] SharedFlowForwardAction} as the type.
      */ 
-    protected static class GlobalAppActionMapping extends ActionMapping
+    protected static class SharedFlowActionMapping extends ActionMapping
     {
-        public GlobalAppActionMapping( String actionPath )
+        public SharedFlowActionMapping( String actionPath, String 
sharedFlowModulePath )
         {
-            setPath( actionPath );
+            setPath( sharedFlowModulePath + actionPath );
         }
         
         public String getType()
         {
-            return GlobalAppForwardAction.class.getName();
-
+            return SharedFlowForwardAction.class.getName();
         }
         
         public boolean getValidate()
@@ -811,21 +801,19 @@
      * Used by [EMAIL PROTECTED] PageFlowRequestProcessor#processMapping}.  
This action simply forwards to the stored action-path,
      * but within the Struts module associated with Global.app.
      */ 
-    public static class GlobalAppForwardAction extends Action
+    public static class SharedFlowForwardAction extends Action
     {
         public ActionForward execute( ActionMapping mapping, ActionForm form, 
HttpServletRequest request,
                                       HttpServletResponse response )
         {
-            assert mapping instanceof GlobalAppActionMapping : 
mapping.getClass().getName();
-            
-            String actionPath = PageFlowConstants.GLOBALAPP_MODULE_CONTEXT_PATH
-                                 + mapping.getPath() 
-                                 + PageFlowConstants.ACTION_EXTENSION;
+            assert mapping instanceof SharedFlowActionMapping : 
mapping.getClass().getName();
+            String actionPath = mapping.getPath() + 
PageFlowConstants.ACTION_EXTENSION;
             ActionForward retval = new ActionForward( actionPath, false );
             retval.setContextRelative( true );
             return retval;
         }
     }
+    
     /**
      * Used by [EMAIL PROTECTED] PageFlowRequestProcessor#processMapping}.  
Its main job is to return
      * [EMAIL PROTECTED] ExceptionHandledAction} as the type.
@@ -883,7 +871,8 @@
         
         if ( returningForm != null )
         {
-            String qualifiedPath = path + "_" + 
returningForm.getClass().getName().replace( '.', '_' ).replace( '$', '_' );
+            String qualifiedPath =
+                    path + '_' + returningForm.getClass().getName().replace( 
'.', '_' ).replace( '$', '_' );
             
             ActionMapping mapping = ( ActionMapping ) 
moduleConfig.findActionConfig( qualifiedPath );
             if ( mapping != null )
@@ -980,11 +969,8 @@
             {
                 ServletContext servletContext = getServletContext();
                 fc = FlowControllerFactory.getPageFlowForURI( request, 
response, originalRequestURI, servletContext );
-
-                if ( fc == null )
-                {
-                    fc = InternalUtils.ensureGlobalApp( request, response, 
servletContext );
-                }
+                if ( fc == null ) fc = PageFlowUtils.getSharedFlow( request, 
servletContext );
+                
                 if ( fc != null )
                 {
                     Exception ex = new ActionNotFoundException( path, fc, 
returningForm );
@@ -1012,16 +998,23 @@
         }
         else
         {
-            // Try letting Global.app handle this action.
-            if ( _log.isDebugEnabled() )
+            SharedFlowController sf = PageFlowUtils.getSharedFlow( request, 
getServletContext() );
+            
+            if ( sf != null )
             {
-                _log.debug( "Action \"" + path + "\" not handled in request 
for "
-                            + request.getRequestURI() + ".  Trying this action 
on Global.app." );
+                // Try letting the SharedFlowController handle this action.
+                if ( _log.isDebugEnabled() )
+                {
+                    _log.debug( "Action \"" + path + "\" not handled in 
request for "
+                                + request.getRequestURI() + ".  Trying this 
action on the SharedFlowController." );
+                }
+                
+                RequestVariables.get( request ).setOriginalRequestURI( 
InternalUtils.decodeURI( request ) );
+                return new SharedFlowActionMapping( path, sf.getModulePath() );
             }
-            
-            RequestVariables.get( request ).setOriginalRequestURI( 
InternalUtils.decodeURI( request ) );
-            return new GlobalAppActionMapping( path );
         }
+        
+        return null;
     }
     
     protected boolean processRoles( HttpServletRequest request, 
HttpServletResponse response, ActionMapping mapping )
@@ -1033,7 +1026,7 @@
         String roles[] = mapping.getRoleNames();
         if ( roles == null || roles.length < 1 )
         {
-            return ( true );
+            return true;
         }
 
         // Check the current user against the list of required roles
@@ -1071,7 +1064,7 @@
         return result;
     }
     
-    private String addScopeParams( String url, HttpServletRequest request )
+    private static String addScopeParams( String url, HttpServletRequest 
request )
     {
         //
         // If the current request is scoped, add the right request parameter 
to the URL.
@@ -1103,7 +1096,7 @@
         //
         if ( fwd != null )
         {
-            if ( _log.isDebugEnabled() ) _log.debug( "processForwardConfig(" + 
fwd + ")" );
+            if ( _log.isDebugEnabled() ) _log.debug( "processForwardConfig(" + 
fwd + ')' );
     
             //
             // If this is a "special" page flow forward, create a Forward to 
handle it and pass
@@ -1183,11 +1176,11 @@
         
         if ( ! attrs.isEmpty() )
         {
-            String hash = new Integer( request.hashCode() ).toString();
+            String hash = Integer.toString( request.hashCode() );
             String key = makeRedirectedRequestAttrsKey( webappRelativeURI, 
hash );
             request.getSession().setAttribute( key, attrs );
             queryString = URLRewriterService.rewriteName( servletContext, 
request, REDIRECT_REQUEST_ATTRS_PARAM )
-                            + "=" + hash;
+                            + '=' + hash;
         }
 
         
@@ -1337,7 +1330,7 @@
                     ActionInterceptorChain.getAfterActionChain( actionName, 
request, servletContext );
             if ( interceptorChain != null )
             {
-                InterceptorForward originalForward = ( ret != null ? new 
InterceptorForward( ret ) : null );
+                InterceptorForward originalForward = ret != null ? new 
InterceptorForward( ret ) : null;
                 InterceptorForward interceptorForward =
                         interceptorChain.doIntercept( request, response, 
originalForward, pfc, actionName );
                 

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
     Fri Aug 13 23:06:05 2004
@@ -95,11 +95,7 @@
      */
     public static String getModulePathForRelativeURI( String uri )
     {
-        if ( uri.length() == 0 )
-        {
-            return "/";
-        }
-        
+        assert uri.length() > 0;
         assert uri.charAt( 0 ) == '/' : uri;
 
         // Strip off the actual page name (e.g., some_page.jsp)
@@ -132,23 +128,8 @@
     public static final String getRelativeURI( HttpServletRequest request, 
String uri, PageFlowController relativeTo )
     {
         String contextPath = request.getContextPath();
-
-        if ( relativeTo != null )
-        {
-            contextPath += relativeTo.getModulePath();
-        }
-
-        String requestUrl = uri;
-        int overlap = requestUrl.indexOf( contextPath );
-
-        if ( overlap != -1 )
-        {
-            return requestUrl.substring( overlap + contextPath.length() );
-        }
-        else
-        {
-            return requestUrl;
-        }
+        if ( relativeTo != null ) contextPath += relativeTo.getModulePath();
+        return ScopedServletUtils.getRelativeURI( contextPath, uri );
     }
 
     /**
@@ -251,21 +232,40 @@
      */ 
     public static GlobalApp getGlobalApp( HttpServletRequest request )
     {
-        HttpSession session = request.getSession( false );
+        SharedFlowController sf = getSharedFlow( GLOBALAPP_CLASSNAME, request 
);
+        return sf instanceof GlobalApp ? ( GlobalApp ) sf : null;
+    }
 
+    public static SharedFlowController getSharedFlow( HttpServletRequest 
request, ServletContext servletContext )
+    {
+        String className = InternalUtils.getSharedFlowClassName( request, 
servletContext );
+        return className != null ? getSharedFlow( className, request ) : null;
+    }
+    
+    public static SharedFlowController getSharedFlow( String 
sharedFlowClassName, HttpServletRequest request )
+    {
+        HttpSession session = request.getSession( false );
+        
         if ( session != null )
         {
-            GlobalApp current = ( GlobalApp ) session.getAttribute( 
GLOBALAPP_ATTR );
-
-            if ( current != null )
-            {
-                return current;
-            }
+            return ( SharedFlowController ) session.getAttribute( 
SHARED_FLOW_ATTR_PREFIX + sharedFlowClassName );
         }
-
+        
         return null;
     }
-
+    
+    public static void deleteGlobalApp( HttpServletRequest request )
+    {
+        deleteSharedFlow( GLOBALAPP_CLASSNAME, request );
+    }
+    
+    public static void deleteSharedFlow( String sharedFlowClassName, 
HttpServletRequest request )
+    {
+        HttpSession session = request.getSession( false );
+        if ( session != null ) request.getSession().removeAttribute( 
SHARED_FLOW_ATTR_PREFIX + sharedFlowClassName );
+    }
+    
+    
     /**
      * Delete a "singleton" page flow from the session. Once it is created, a 
singleton page flow
      * is never removed from the session unless this method or [EMAIL 
PROTECTED] PageFlowController#delete} is

Added: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
      Fri Aug 13 23:06:05 2004
@@ -0,0 +1,147 @@
+/*
+* B E A   S Y S T E M S
+* Copyright 2002-2004  BEA Systems, Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* 
+*     http://www.apache.org/licenses/LICENSE-2.0
+* 
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* $Header:$
+*/
+package org.apache.beehive.netui.pageflow;
+
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionMapping;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
+
+
+// TODO: javadoc
+public abstract class SharedFlowController
+        extends FlowController
+        implements PageFlowConstants
+{
+    private transient String _modulePath;
+    
+    /**
+     * Get the Struts module path.
+     * 
+     * @return "/-global".
+     */ 
+    public String getModulePath()
+    {
+        if ( _modulePath == null )
+        {
+            String className = getClass().getName();
+            int lastDot = className.lastIndexOf( '.' );
+            assert lastDot != -1 : className;
+            className = className.substring( 0, lastDot );
+            _modulePath = "/-" + className.replace( '.', '/' );
+        }
+        
+        return _modulePath;
+    }
+    
+    void persistInSession( HttpServletRequest request, HttpServletResponse 
response,
+                           ServletContext servletContext )
+    {
+        request.getSession().setAttribute( SHARED_FLOW_ATTR_PREFIX + 
getClass().getName(), this );
+    }
+    
+    /**
+     * @exclude
+     */ 
+    public void reInit( ServletContext servletContext )
+    {
+        if ( getServlet() == null )
+        {
+            setServlet( InternalUtils.getActionServlet( servletContext ) );    
        
+        }
+    }
+    
+    /**
+     * Ensures that any changes to this FlowController will be replicated in a 
cluster (for failover),
+     * even if the replication scheme uses a change-detection algorithm that 
relies on
+     * HttpSession.setAttribute to be aware of changes.
+     * 
+     * @param request the current HttpServletRequest
+     */
+    public void ensureFailover( HttpServletRequest request )
+    {
+        InternalUtils.getServerAdapter().ensureFailover( 
SHARED_FLOW_ATTR_PREFIX + getClass().getName(), this, request );
+    }
+    
+    /**
+     * Get the URI.
+     * @return <code>null</code>, as this object is not URL-addressible.
+     */
+    public String getURI()
+    {
+        return "/";
+    }
+    
+    public String getDisplayName()
+    {
+        return getClass().getName();
+    }
+    
+    PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, 
HttpServletRequest request )
+    {
+        assert curJpf != null;
+        return curJpf.getCurrentPageInfo();        
+    }
+    
+    /**
+     * Called from [EMAIL PROTECTED] FlowController#forwardTo}.
+     */ 
+    void savePreviousPageInfo( ActionForward forward, ActionForm form, 
ActionMapping mapping,
+                               HttpServletRequest request, ServletContext 
servletContext,
+                               boolean isSpecialForward )
+    {
+        //
+        // Special case: if the given forward has a path to a page in the 
current pageflow,
+        // let that pageflow save the info on this page.  Otherwise, don't 
ever save any
+        // info on what we're forwarding to.
+        //
+        if ( ! isSpecialForward && forward != null )  // i.e., it's a straight 
Forward to a path, not a navigateTo, etc.
+        {
+            PageFlowController currentJpf = PageFlowUtils.getCurrentPageFlow( 
request );
+            
+            if ( currentJpf != null )
+            {
+                if ( forward.getContextRelative() && 
forward.getPath().startsWith( currentJpf.getModulePath() ) )
+                {
+                    currentJpf.savePreviousPageInfo( forward, form, mapping, 
request, servletContext,
+                                                     isSpecialForward );
+                }
+            }
+        }
+    }
+    
+    /**
+     * Remove this instance from the session.
+     */ 
+    protected void delete()
+    {
+        PageFlowUtils.deleteSharedFlow( getClass().getName(), getRequest() );
+    }
+    
+    void setImplicitObject( HttpServletRequest request )
+    {
+        request.setAttribute( 
InternalConstants.SHARED_FLOW_IMPLICIT_OBJECT_NAME, this );
+    }
+}

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java
   Fri Aug 13 23:06:05 2004
@@ -150,7 +150,7 @@
      */
     @Target( ElementType.METHOD )
             @Retention( RetentionPolicy.RUNTIME )
-            public @interface Action
+    public @interface Action
     {
         /**
          * page flow-scoped form; references a member variable (bean) in the 
page flow
@@ -703,6 +703,12 @@
     public @interface FormBean
     {
         String defaultMessageBundle() default "";
+    }
+
+    @Target( ElementType.FIELD )
+    @Retention( RetentionPolicy.RUNTIME )
+    public @interface SharedFlowField
+    {
     }
     
     @Target( ElementType.TYPE )

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
   Fri Aug 13 23:06:05 2004
@@ -20,6 +20,9 @@
 
 import org.apache.struts.config.ControllerConfig;
 
+import java.util.List;
+import java.util.Arrays;
+
 public class PageFlowControllerConfig extends ControllerConfig
 {
     private boolean _isNestedPageFlow;
@@ -27,6 +30,9 @@
     private boolean _isReturnToPageDisabled;
     private boolean _isReturnToActionDisabled;
     private boolean _isMissingDefaultMessages;
+    private List< String > _sharedFlowModules;
+    private String _controllerClass;
+    private boolean _isSharedFlow;
 
     
     public boolean isNestedPageFlow()
@@ -77,5 +83,40 @@
     public void setIsMissingDefaultMessages( boolean missingDefaultMessages )
     {
         _isMissingDefaultMessages = missingDefaultMessages;
+    }
+
+    public void setSharedFlowModules( String sharedFlowModules )
+    {
+        _sharedFlowModules = Arrays.asList( sharedFlowModules.split( ";" ) );
+    }
+
+    public String getSharedFlowModules()
+    {
+        throw new IllegalStateException( "not implemented" );
+    }
+    
+    public List< String > getSharedFlowModulesList()
+    {
+        return _sharedFlowModules;
+    }
+
+    public String getControllerClass()
+    {
+        return _controllerClass;
+    }
+
+    public void setControllerClass( String controllerClass )
+    {
+        _controllerClass = controllerClass;
+    }
+
+    public boolean isSharedFlow()
+    {
+        return _isSharedFlow;
+    }
+
+    public void setIsSharedFlow( boolean sharedFlow )
+    {
+        _isSharedFlow = sharedFlow;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/CachedPageFlowInfo.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/CachedPageFlowInfo.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/CachedPageFlowInfo.java
       Fri Aug 13 23:06:05 2004
@@ -19,6 +19,7 @@
 package org.apache.beehive.netui.pageflow.internal;
 
 import org.apache.beehive.netui.pageflow.PageFlowConstants;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
 
 import java.lang.reflect.Field;
 
@@ -41,25 +42,27 @@
     private String _URI;
     
     /**
-     * The globalApp member field -- may or may not be present.
+     * The SharedFlowController-initialized member field -- may or may not be 
present.
      */ 
-    private Field _globalAppMemberField;
+    private Field _sharedFlowMemberField;
     
     
     public CachedPageFlowInfo( Class pageFlowClass )
     {
-        //
-        // globalApp field
-        //
-        try
-        {
-            _globalAppMemberField = pageFlowClass.getDeclaredField( 
PageFlowConstants.GLOBALAPP_MEMBER_NAME );
-            _globalAppMemberField.setAccessible( true );
-        }
-        catch ( NoSuchFieldException e )
+        Field[] fields = pageFlowClass.getDeclaredFields();
+        
+        for ( int i = 0; i < fields.length; i++ )
         {
-            // This means there is no declared globalApp field.
-            _globalAppMemberField = null;
+            Field field = fields[i];
+            
+            // TODO: auto-upgrade to get rid of legacy "globalApp" field
+            if ( field.getAnnotation( Jpf.SharedFlowField.class ) != null
+                 || field.getName().equals( 
PageFlowConstants.GLOBALAPP_MEMBER_NAME ) )
+            {
+                _sharedFlowMemberField = field;
+                _sharedFlowMemberField.setAccessible( true );
+                break;
+            }
         }
         
         //
@@ -104,13 +107,13 @@
         _URI = URI;
     }
 
-    public Field getGlobalAppMemberField()
+    public Field getSharedFlowMemberField()
     {
-        return _globalAppMemberField;
+        return _sharedFlowMemberField;
     }
 
-    public void setGlobalAppMemberField( Field globalAppMemberField )
+    public void setSharedFlowMemberField( Field sharedFlowMemberField )
     {
-        _globalAppMemberField = globalAppMemberField;
+        _sharedFlowMemberField = sharedFlowMemberField;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
 Fri Aug 13 23:06:05 2004
@@ -44,6 +44,7 @@
 import org.apache.beehive.netui.pageflow.PageFlowUtils;
 import org.apache.beehive.netui.pageflow.PageFlowException;
 import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.netui.pageflow.PageFlowController;
 import org.apache.beehive.netui.pageflow.handler.ExceptionsHandler;
 import org.apache.beehive.netui.pageflow.internal.DefaultHandler;
 import org.apache.beehive.netui.util.Bundle;
@@ -94,11 +95,12 @@
         if ( exceptionConfig == null )
         {
             ServletContext servletContext = 
flowController.getServlet().getServletContext();
-            exceptionConfig = getAlternateExceptionConfig( exClass, request, 
servletContext );
+            exceptionConfig =
+                    getAlternateExceptionConfig( exClass, flowController, 
request, servletContext );
             
             if ( exceptionConfig != null )
             {
-                flowController = getAlternateFlowController( request, 
response, servletContext );
+                flowController = getAlternateFlowController( flowController, 
request, response, servletContext );
                 if ( flowController == null ) exceptionConfig = null;   // 
must have both for this to work.
             }
             
@@ -187,17 +189,20 @@
         return config;
     }
     
-    protected ExceptionConfig getAlternateExceptionConfig( Class exClass, 
HttpServletRequest request,
-                                                           ServletContext 
servletContext )
+    protected ExceptionConfig getAlternateExceptionConfig( Class exClass, 
FlowController originalFlowController,
+                                                           HttpServletRequest 
request, ServletContext servletContext )
     {
-        ModuleConfig exceptionHandlerModuleConfig = 
InternalUtils.getGlobalAppConfig( servletContext );                
+        ModuleConfig exceptionHandlerModuleConfig =
+                InternalUtils.getSharedFlowConfig( 
originalFlowController.getModuleConfig(), servletContext );
         return getExceptionConfig( exClass, exceptionHandlerModuleConfig );
     }
     
-    protected FlowController getAlternateFlowController( HttpServletRequest 
request, HttpServletResponse response,
+    protected FlowController getAlternateFlowController( FlowController 
originalFlowController, 
+                                                         HttpServletRequest 
request, HttpServletResponse response,
                                                          ServletContext 
servletContext )
     {
-        FlowController exceptionController = InternalUtils.ensureGlobalApp( 
request, response, servletContext );
+        FlowController exceptionController = 
+                InternalUtils.getSharedFlow( originalFlowController, request, 
response, servletContext );
                     
         //
         // If there's no Global.app class, then it means there's an orphan 
module configuration file
@@ -209,7 +214,7 @@
 
             if ( _log.isDebugEnabled() )
             {
-                _log.debug( "Found exception-config in Global.app" );
+                _log.debug( "Found exception-config in SharedFlowController " 
+ exceptionController.getDisplayName() );
             }                    
         }
         
@@ -288,7 +293,8 @@
                 err = Bundle.getString( "PageFlow_MissingExceptionHandler", 
methodName );
             }
                     
-            InternalUtils.sendError( "PageFlow_Custom_Error", request, 
response, null, flowController.getURI(), err );
+            InternalUtils.sendError( "PageFlow_Custom_Error", request, 
response, null, flowController.getDisplayName(), 
+                                     err );
             return null;
         }        
     }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalConstants.java
        Fri Aug 13 23:06:05 2004
@@ -29,4 +29,11 @@
     
     public static final String FACES_BACKING_ATTR = 
InternalUtils.class.getName() + "_facesBacking";
     public static final String BACKING_CLASS_IMPLICIT_OBJECT = "backing";
+
+    public static final String GLOBAL_APP_IMPLICIT_OBJECT_NAME = "globalApp";
+    public static final String PAGE_FLOW_IMPLICIT_OBJECT_NAME = "pageFlow";
+    public static final String SHARED_FLOW_IMPLICIT_OBJECT_NAME = "sharedFlow";
+    
+    public static final String SHARED_FLOW_MODULE_PREFIX = "/-";
+    public static final String SHARED_FLOW_ROOT_MODULE = "/-webappRoot";
 }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
    Fri Aug 13 23:06:05 2004
@@ -25,8 +25,9 @@
 import org.apache.beehive.netui.pageflow.ActionResolver;
 import org.apache.beehive.netui.pageflow.AutoRegisterActionServlet;
 import org.apache.beehive.netui.pageflow.ServerAdapter;
-import org.apache.beehive.netui.pageflow.GlobalApp;
 import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.FlowController;
 import org.apache.beehive.netui.pageflow.handler.ReloadableClassHandler;
 import org.apache.beehive.netui.pageflow.config.PageFlowControllerConfig;
 import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
@@ -49,6 +50,7 @@
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Enumeration;
+import java.util.List;
 
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionError;
@@ -56,7 +58,6 @@
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionServlet;
 import org.apache.struts.config.ModuleConfig;
-import org.apache.struts.config.ActionConfig;
 import org.apache.struts.config.ControllerConfig;
 import org.apache.struts.config.FormBeanConfig;
 import org.apache.struts.Globals;
@@ -77,6 +78,7 @@
     private static final String SINGLETON_PAGEFLOWS_ATTR_PREFIX = 
PageFlowUtils.class.getName() + "_singleton:";
     private static final String ACTIONOUTPUT_MAP_ATTR = 
PageFlowUtils.class.getName() + "_actionOutputs";
     private static final String BINDING_UPDATE_ERRORS_ATTR = 
PageFlowUtils.class.getName() + "_bindingUpdateErrors";
+    private static final String SHARED_FLOW_CLASSNAME_ATTR = 
PageFlowUtils.class.getName() + "_sharedFlowClass";
     private static final String CATALINA_HOME_PROP = "catalina.home";
     private static final String SERVER_ADAPTER_PROP = "pageflow.serveradapter";
     private static final String WL_SERVER_ADAPTER_CLASS = 
"com.bea.wlw.netui.pageflow.internal.WebLogicServerAdapter";
@@ -258,55 +260,11 @@
             _log.warn( "could not get ServletContext from request " + request 
);
         }
         
-        return ensureCurrentPageFlow( request, response, servletContext );
+        return FlowControllerFactory.getPageFlowForRequest( request, response, 
servletContext );
     }
     
-    /**
-     * Get or create the current PageFlowConroller for the given request.
-     * 
-     * @param request the current HttpServletRequest.
-     * @param response the current HttpServletResponse.
-     * @param context the current ServletContext.
-     * @return the current PageFlowController in the user session, or if there 
is none, create one
-     * appropriate to the given request if possible.  Failing that, return 
<code>null</code>.
-     */ 
-    public static final PageFlowController ensureCurrentPageFlow( 
HttpServletRequest request,
-                                                                  
HttpServletResponse response,
-                                                                  
ServletContext context )
-    {
-        assert request != null;
-        assert response != null;
-                
-        PageFlowController cur = getCurrentPageFlow( request, false );
-        
-        //
-        // If there's no current PageFlow, or if the current 
PageFlowController has a module path that
-        // is incompatible with the current request URI, then create the 
appropriate PageFlowController.
-        //
-        if ( cur == null
-             || ! PageFlowUtils.getModulePathForRelativeURI( cur.getURI() 
).equals( PageFlowUtils.getModulePath( request ) ) )
-        {
-            cur = FlowControllerFactory.getPageFlowForRequest( request, 
response, context );
-        }
-        
-        return cur;        
-    }
-    
-    /**
-     * Get the class name for a [EMAIL PROTECTED] PageFlowController} (.jpf) 
in the given module path (the
-     * given directory, relative to the web application root).
-     * @exclude
-     * 
-     * @param modulePath the module path, relative to the web application root.
-     * @return the class name of the PageFlowController, or <code>null</code> 
if none is found.
-     */
-    public static String getPageFlowClassName( String modulePath, 
ServletRequest request, ServletContext context )
+    public static String getFlowControllerClassName( String modulePath, 
ServletRequest request, ServletContext context )
     {
-        if ( modulePath.equals( GLOBALAPP_MODULE_CONTEXT_PATH ) )
-        {
-            return GLOBALAPP_CLASSNAME;
-        }
-
         //
         // We're going to look in the struts config to get the 
PageFlowController class.
         //
@@ -321,22 +279,13 @@
             _log.error( "Error while registering Struts module " + modulePath, 
e );
         }
         
-        if ( mc != null )
-        {
-            ActionConfig beginActionConfig = mc.findActionConfig( 
BEGIN_ACTION_PATH );
-                
-            if ( beginActionConfig != null )
-            {
-                return beginActionConfig.getType();
-            }
-        }
-
-        if ( _log.isInfoEnabled() )
-        {
-            _log.info( "Could not find pageflow for path " + modulePath );
-        }
-        
-        return null;
+        return mc != null ? getFlowControllerClassName( mc ) : null;
+    }
+    
+    public static String getFlowControllerClassName( ModuleConfig mc )
+    {
+        ControllerConfig cc = mc.getControllerConfig();
+        return cc instanceof PageFlowControllerConfig ? ( ( 
PageFlowControllerConfig ) cc ).getControllerClass() : null;
     }
     
     /**
@@ -457,11 +406,6 @@
         return SINGLETON_PAGEFLOWS_ATTR_PREFIX + modulePath;
     }
     
-    public static void deleteGlobalApp( HttpServletRequest request )
-    {
-        request.getSession().removeAttribute( GLOBALAPP_ATTR );
-    }
-    
     public static void setCurrentPageFlow( PageFlowController jpf, 
HttpServletRequest request )
     {
         setCurrentActionResolver( jpf, request );
@@ -586,13 +530,14 @@
     }
     
     /**
-     * Get the Struts ModuleConfig associated with Global.app
-     * 
-     * @param context the current ServletContext
+     * Get the Struts ModuleConfig associated with the SharedFlowController 
for the given FlowController module.
      */ 
-    public static ModuleConfig getGlobalAppConfig( ServletContext context )
+    public static ModuleConfig getSharedFlowConfig( ModuleConfig 
flowControllerConfig, ServletContext servletContext )
     {
-        return getModuleConfig( GLOBALAPP_MODULE_CONTEXT_PATH, context );
+        ControllerConfig cc = flowControllerConfig.getControllerConfig();
+        if ( ! ( cc instanceof PageFlowControllerConfig ) ) return null;
+        List< String > sfModules = ( ( PageFlowControllerConfig ) cc 
).getSharedFlowModulesList();
+        return sfModules != null && sfModules.size() > 0 ? getModuleConfig( 
sfModules.get( 0 ), servletContext ) : null;
     }
     
     /**
@@ -813,35 +758,35 @@
     }
     
     /**
-     * Get or create the current [EMAIL PROTECTED] 
org.apache.beehive.netui.pageflow.GlobalApp} instance.
+     * Get or create the current [EMAIL PROTECTED] SharedFlowController} 
instance.
      * 
      * @param request the current HttpServletRequest.
      * @param response the current HttpServletResponse
-     * @return the current [EMAIL PROTECTED] 
org.apache.beehive.netui.pageflow.GlobalApp} from the user session, or a 
newly-instantiated one
-     *         (based on the user's Global.app file) if none was in the 
session.  Failing that,
-     *         return <code>null</code>.
+     * @return the current applicable [EMAIL PROTECTED] SharedFlowController} 
from the user session, or a newly-instantiated one
+      *        if none was in the session.  Failing that, return 
<code>null</code>.
      */ 
-    public static GlobalApp ensureGlobalApp( HttpServletRequest request, 
HttpServletResponse response )
+    public static SharedFlowController ensureSharedFlow( HttpServletRequest 
request, HttpServletResponse response )
     {
-        return ensureGlobalApp( request, response, 
SERVER_ADAPTER.getServletContext( request ) );
+        return ensureSharedFlow( request, response, 
SERVER_ADAPTER.getServletContext( request ) );
     }
     
     /**
-     * Get or create the current [EMAIL PROTECTED] GlobalApp} instance.
+     * Get or create the current [EMAIL PROTECTED] SharedFlowController} 
instance.
      * 
      * @param request the current HttpServletRequest.
      * @param response the current HttpServletResponse
-     * @return the current [EMAIL PROTECTED] GlobalApp} from the user session, 
or a newly-instantiated one
-     *         (based on the user's Global.app file) if none was in the 
session.  Failing that,
-     *         return <code>null</code>.
+     * @param servletContext the current ServletContext
+     * @return the current applicable [EMAIL PROTECTED] SharedFlowController} 
from the user session, or a newly-instantiated one
+     *        if none was in the session.  Failing that, return 
<code>null</code>.
      */ 
-    public static GlobalApp ensureGlobalApp( HttpServletRequest request, 
HttpServletResponse response,
-                                             ServletContext servletContext )
+    public static SharedFlowController ensureSharedFlow( HttpServletRequest 
request, HttpServletResponse response,
+                                                         ServletContext 
servletContext )
     {
         assert request != null;
         assert response != null;
         
-        GlobalApp cur = PageFlowUtils.getGlobalApp( request );
+        String sharedFlowClassName = getSharedFlowClassName( request, 
servletContext );
+        SharedFlowController cur = PageFlowUtils.getSharedFlow( 
sharedFlowClassName, request );
         
         if ( cur != null )
         {
@@ -850,7 +795,7 @@
         }
         else
         {
-            return FlowControllerFactory.getGlobalApp( request, response, 
servletContext );
+            return FlowControllerFactory.getSharedFlow( sharedFlowClassName, 
request, response, servletContext );
         }
     }
 
@@ -935,9 +880,98 @@
         }
     }
     
-    public static void setGlobalApp( GlobalApp ga, HttpServletRequest request )
+    public static String getSharedFlowClassName( HttpServletRequest request, 
ServletContext servletContext )
+    {
+        return getSharedFlowClassNameForURI( InternalUtils.decodeURI( request 
), request, servletContext );
+    }    
+    
+    public static String getSharedFlowClassNameForURI( String uri, 
HttpServletRequest request,
+                                                       ServletContext 
servletContext )
+    {
+        String cachedInRequest = ( String ) request.getAttribute( 
SHARED_FLOW_CLASSNAME_ATTR );
+        if ( cachedInRequest != null ) return cachedInRequest.length() > 0 ? 
cachedInRequest : null;
+        
+        // TODO: must cache this
+        String relativeUrl = PageFlowUtils.getRelativeURI( request, uri, null 
);
+        String parentDir = PageFlowUtils.getModulePathForRelativeURI( 
relativeUrl );
+        String className = null;
+        
+        if ( parentDir.length() > 0 )
+        {
+            assert parentDir.charAt( 0 ) == '/' : parentDir;
+            parentDir = SHARED_FLOW_MODULE_PREFIX + parentDir.substring( 1 );
+            
+            do
+            {
+                className = getFlowControllerClassName( parentDir, request, 
servletContext );
+                if ( className!= null ) break;
+                int lastSlash = parentDir.lastIndexOf( '/' );
+                parentDir = parentDir.substring( 0, lastSlash );
+            } while ( parentDir.length() > 0 );
+        }
+        
+        if ( className == null ) 
+        {
+            className = getFlowControllerClassName( SHARED_FLOW_ROOT_MODULE, 
request, servletContext );
+        }
+        
+        if ( className == null ) 
+        {
+            className = getFlowControllerClassName( 
GLOBALAPP_MODULE_CONTEXT_PATH, request, servletContext );
+        }
+        
+        request.setAttribute( SHARED_FLOW_CLASSNAME_ATTR, className != null ? 
className : "" );
+        return className;
+    }    
+    
+    public static FlowController getFlowController( Class fcClass, 
HttpServletRequest request,
+                                                    HttpServletResponse 
response, ServletContext servletContext )
+    {
+        if ( PageFlowController.class.isAssignableFrom( fcClass ) )
+        {
+            PageFlowController current = getCurrentPageFlow( request, false );
+            
+            if ( current != null && current.getClass().equals( fcClass ) )
+            {
+                if ( _log.isDebugEnabled() )
+                {
+                    _log.debug( "Using current page flow: " + current );
+                }
+                
+                //
+                // Reinitialize transient data that may have been lost on 
session failover.
+                //
+                current.reinitialize( request, response, servletContext );
+                return current;
+            }
+            
+            return FlowControllerFactory.getPageFlow( fcClass, request, 
response, servletContext );
+        }
+        else
+        {
+            assert SharedFlowController.class.isAssignableFrom( fcClass ) : 
fcClass.getName();
+            
+            SharedFlowController current = PageFlowUtils.getSharedFlow( 
fcClass.getName(), request );
+            if ( current != null ) return current;
+            return FlowControllerFactory.getSharedFlow( fcClass, request, 
response, servletContext );
+        }
+    }
+    
+    public static SharedFlowController getSharedFlow( FlowController pfc, 
HttpServletRequest request, 
+                                                      HttpServletResponse 
response, ServletContext servletContext )
+    {
+        ModuleConfig sfConfig = getSharedFlowConfig( pfc.getModuleConfig(), 
servletContext );
+        if ( sfConfig == null ) return null;
+        String sfClassName = getFlowControllerClassName( sfConfig );
+        if ( sfClassName == null ) return null;
+        SharedFlowController sf = PageFlowUtils.getSharedFlow( sfClassName, 
request );
+        return sf != null ? sf : FlowControllerFactory.getSharedFlow( 
sfClassName, request, response, servletContext );
+    }
+    
+    public static boolean isSharedFlowModule( ModuleConfig mc )
     {
-        request.getSession().setAttribute( GLOBALAPP_ATTR, ga );
+        ControllerConfig cc = mc.getControllerConfig();
+        return cc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) cc ).isSharedFlow();
     }
     
     public static void setFacesBackingBean( HttpServletRequest request, 
ServletContext servletContext )

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
     Fri Aug 13 23:06:05 2004
@@ -25,10 +25,8 @@
 import java.util.Iterator;
 
 //internal imports
-import org.apache.beehive.netui.pageflow.util.URLRewriterService;
-import org.apache.beehive.netui.pageflow.util.URLRewriter;
-import org.apache.beehive.netui.pageflow.PageFlowUtils;
 import org.apache.beehive.netui.pageflow.FlowController;
+import org.apache.beehive.netui.pageflow.FlowControllerFactory;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
 
 import org.apache.beehive.netui.util.logging.Logger;
@@ -41,13 +39,14 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.struts.action.Action;
 import org.apache.struts.config.ModuleConfig;
 import org.apache.struts.config.ForwardConfig;
 import org.apache.struts.Globals;
 import org.apache.struts.util.MessageResources;
 import org.apache.struts.util.RequestUtils;
 
+import static 
org.apache.beehive.netui.pageflow.PageFlowConstants.ACTION_EXTENSION;
+
 
 /**
  * @exclude
@@ -251,13 +250,14 @@
             String checkAction = action;
             if (checkAction.startsWith("/"))
                 checkAction = checkAction.substring(1);
-            if (checkAction.endsWith(".do"))
-                checkAction = checkAction.substring(0, 
checkAction.indexOf(".do"));
+            if (checkAction.endsWith(ACTION_EXTENSION))
+                checkAction = checkAction.substring(0, checkAction.length() - 
ACTION_EXTENSION.length());
             isAnAction = flowController.isAction(checkAction);
 
             if (!isAnAction)
             {
-                FlowController globalController = 
InternalUtils.ensureGlobalApp(request, response, servletContext);
+                FlowController globalController =
+                        FlowControllerFactory.getSharedFlowForRequest( 
request, response, servletContext );
                 if (globalController != null)
                     isAnAction = globalController.isAction(checkAction);
             }

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
   Fri Aug 13 23:06:05 2004
@@ -113,7 +113,7 @@
         HttpServletRequest hReq = (HttpServletRequest)request;
         HttpServletResponse hResp = (HttpServletResponse)response;
 
-        GlobalApp ga = InternalUtils.ensureGlobalApp(hReq, hResp);
+        GlobalApp ga = PageFlowUtils.getGlobalApp(hReq);
         
         if(ga == null) 
         {

Modified: 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
 Fri Aug 13 23:06:05 2004
@@ -337,10 +337,19 @@
      */
     public static final String getRelativeURI( HttpServletRequest request, 
String uri )
     {
-        String contextPath = request.getContextPath();
-
+        return getRelativeURI( request.getContextPath(), uri );
+    }
+    
+    /**
+     * Get a URI relative to a given webapp root.
+     *
+     * @param contextPath the webapp context path, e.g., "/myWebapp"
+     * @param uri the URI which should be made relative.
+     */
+    public static final String getRelativeURI( String contextPath, String uri )
+    {
         String requestUrl = uri;
-        int overlap = requestUrl.indexOf( contextPath );
+        int overlap = requestUrl.indexOf( contextPath + '/' );
 
         if ( overlap != -1 )
         {

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
    Fri Aug 13 23:06:05 2004
@@ -957,9 +957,9 @@
         }
 
         //
-        // If the current module is "/-global" (Global.app), then we'll first 
try the module
-        // associated with the current pageflow.  Later we'll try "/-global".
-        if 
(_appConfig.getPrefix().equals(PageFlowConstants.GLOBALAPP_MODULE_CONTEXT_PATH))
 {
+        // If the current module is a SharedFlowController module, then we'll 
first try the module
+        // associated with the current pageflow.  Later we'll retry this one 
if necessary.
+        if (InternalUtils.isSharedFlowModule(_appConfig)) {
             PageFlowController curPgr = 
PageFlowUtils.getCurrentPageFlow(request);
 
             if (curPgr != null) {
@@ -978,14 +978,14 @@
 
         // If we didn't find it in the current module's config, look in 
Global.app
         if (_mapping == null) {
-            ModuleConfig globalAppConfig = 
InternalUtils.getGlobalAppConfig(servletContext);
+            ModuleConfig sharedFlowConfig = 
InternalUtils.getSharedFlowConfig(_appConfig, servletContext);
 
-            if (globalAppConfig != null) {
+            if (sharedFlowConfig != null) {
                 ActionMapping globalMapping =
-                        (ActionMapping) 
globalAppConfig.findActionConfig(mappingName);
+                        (ActionMapping) 
sharedFlowConfig.findActionConfig(mappingName);
 
                 if (globalMapping != null) {
-                    _appConfig = globalAppConfig;
+                    _appConfig = sharedFlowConfig;
                     _mapping = globalMapping;
                 }
             }

Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/SharedFlow.jpfs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/SharedFlow.jpfs      
Fri Aug 13 23:06:05 2004
@@ -0,0 +1,521 @@
+package webappRoot;
+
+import org.apache.beehive.netui.pageflow.*;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.util.Arrays;
+
+import shared.FormA;
+import shared.QaTrace;
+
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionForward;
+
+import pageFlowCore.returnToTest.returnToTestController.InputForm;
+
+
[EMAIL PROTECTED]
+public class SharedFlow extends SharedFlowController
+{
+    private String _pageGroupState = "";
+    private String _results;
+    private String _globalAppInfo = "";
+
+    // from QA Global.app
+    private  boolean  _toggle  = true;
+    private QaTrace _log = null;
+    private int     _cnt = 0;
+
+    /** 
+     * This property is referenced by the databinding/globalApp/nojpf/ BVT.
+     */
+    public String getSayHello()
+    {
+        return "Hello World! -- the Global.app";
+    }
+
+    public static class GlobalForm extends FormData
+    {
+       String _search;
+       public void setSearch(String search) {
+           _search = search;
+       }
+       public String getSearch() {
+           return _search;
+       }
+    }  
+
+    public String getAppState() {
+       return "running";
+    }
+
+    public String getAppInfo() {
+       return "App DRT";
+    }
+
+    public String getResults() {
+       return _results;
+    }
+    public void setResults(String results) {
+       _results = results;
+    }
+
+    public String getPageFlowState() {
+       return _pageGroupState;
+    }
+    public void setPageFlowState(String pgs) {
+       _pageGroupState = pgs;
+    }
+
+    public String getGlobalAppInfo() {
+        return _globalAppInfo;
+    }
+    
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "nesting", path = 
"/globalJpfs/nestReturn/Controller.jpf") })
+    public Forward globalAction_action()
+    {
+        return new Forward("nesting");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "nesting", path = 
"/globalJpfs/nestReturn/Controller.jpf") })
+    public Forward globalAction_form(GlobalForm form)
+    {
+        return new Forward("nesting");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "return", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    public Forward globalAction_getInfo(GlobalForm form)
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("<table border='1' cellspacing='0'cellpaddinig='2'>");
+
+        sb = new StringBuffer();
+        sb.append("<table border='1' cellspacing='0'cellpaddinig='2'>");
+
+        HttpServletRequest req = getRequest();
+        sb.append("<tr><td>Request</td><td>");
+        sb.append(req.getRequestURI());
+        sb.append("</td></tr>");
+
+
+        HttpServletResponse resp = getResponse();
+        sb.append("<tr><td>Response</td><td>Committed:");
+        sb.append("" + resp.isCommitted());
+        sb.append("</td></tr>");
+
+
+        HttpSession session = getSession();
+        session.setMaxInactiveInterval( 3600 );
+        sb.append("<tr><td>Session</td><td>In active interval:");
+        sb.append("" + session.getMaxInactiveInterval());
+        sb.append("</td></tr>");
+
+        // nestable
+        sb.append("<tr><td>Nestable</td><td>");
+        sb.append("" + isNestable());
+        sb.append("</td></tr>");
+
+        // nestable
+        sb.append("<tr><td>PageFlow</td><td>");
+        sb.append("" + isPageFlow());
+        sb.append("</td></tr>");
+
+        // get action
+        sb.append("<tr><td>Actions</td><td>");
+        String[] actions = getActions();
+        Arrays.sort(actions);
+        for (int i=0;i<actions.length;i++) {
+            sb.append(actions[i]);
+            sb.append("<br />");
+        }
+        sb.append("</td></tr>");
+
+
+        // get mapping
+        ActionMapping map = getMapping();
+        sb.append("<tr><td>ActionMapping</td><td>");
+        sb.append("" + map);
+        sb.append("</td></tr>");
+
+        // URI
+        sb.append("<tr><td>URI</td><td>");
+        sb.append("" + getURI());
+        sb.append("</td></tr>");
+
+        // parent dir
+        sb.append("<tr><td>parentDir</td><td>");
+        sb.append("" + getModulePath());
+        sb.append("</td></tr>");
+
+
+        sb.append("</table>");
+        _globalAppInfo = sb.toString();
+
+        return new Forward("return");
+    }
+
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "results", path = 
"/results/Controller.jpf") })
+    public Forward globalAction_results()
+    {
+        return new Forward("results");
+    }
+
+
+    //
+    // The following actions are for 
/pageFlowCore/returnToTest/returnToTestController.jpf.
+    //
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToCurrentPageOverrideInputs()
+    {
+        Forward fwd = new Forward( "success", "input1", "overridden #1" );
+        fwd.addPageInput( "input2", "overridden #2" );
+        return fwd;
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToCurrentPageOverrideForm()
+    {
+        InputForm overrideForm = new InputForm();
+        overrideForm.setFoo( "override foo" );
+        overrideForm.setBar( "override bar" );
+        return new Forward("success", overrideForm);
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToCurrentPage()
+    {
+        return new Forward("success");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToCurrentPageWithForm( InputForm form )
+    {
+        return new Forward("success");
+    }
+
+
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToPageOverrideInputs()
+    {
+        Forward fwd = new Forward( "success", "input1", "overridden #1" );
+        fwd.addPageInput( "input2", "overridden #2" );
+        return fwd;
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToPageOverrideForm()
+    {
+        InputForm overrideForm = new InputForm();
+        overrideForm.setFoo( "override foo" );
+        overrideForm.setBar( "override bar" );
+        return new Forward("success", overrideForm);
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToPage()
+    {
+        return new Forward("success");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.currentPage) })
+    protected Forward globalReturnToPageWithForm( InputForm form )
+    {
+        return new Forward("success");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.previousPage) })
+    protected Forward globalReturnToPreviousPage()
+    {
+        return new Forward("success");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.previousPage) })
+    protected Forward globalReturnToPreviousPageOverrideInputs()
+    {
+        Forward fwd = new Forward( "success", "input1", "overridden #1" );
+        fwd.addPageInput( "input2", "overridden #2" );
+        return fwd;
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.previousPage) })
+    protected Forward globalReturnToPreviousPageOverrideForm()
+    {
+        InputForm overrideForm = new InputForm();
+        overrideForm.setFoo( "override foo" );
+        overrideForm.setBar( "override bar" );
+        return new Forward("success", overrideForm);
+    }
+   
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.previousAction) })
+    protected Forward globalReturnToPreviousAction()
+    {
+        return new Forward("success");
+    }
+
[EMAIL PROTECTED](forwards = { @Jpf.Forward(name = "success", navigateTo = 
Jpf.NavigateTo.previousAction) })
+    protected Forward globalReturnToAction()
+    {
+        return new Forward("success");
+    }
+
+    // from QA Web
+    /**
+     * onCreate
+     */
+    public void onCreate() throws Exception
+        {
+        HttpSession session = getSession();
+        _log = QaTrace.getTrace(getSession(), true);
+        //_cnt = _log.newClass(this);
+        //_log.tracePoint("Global.onCreate():" + session.hashCode());
+    }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "struts1Do",
+                path = "/interOp/tests/test2/gotoStrutsJSP.do") 
+        })
+   public Forward toLegacy()
+      {
+          // _log.tracePoint("Global.toLegacy():" + _cnt + " - Test2");
+      return new Forward("struts1Do");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "struts2Do",
+                path = "/interOp/tests/test5/gotoStruts2JSP.do") 
+        })
+   public Forward globalAction()
+      {
+          //_log.tracePoint("Global.globalAction():" + _cnt + " - Test5");
+      return new Forward("struts2Do");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "goBack",
+                navigateTo = Jpf.NavigateTo.previousPage) 
+        })
+   public Forward test35GlobalAction()
+      {
+          //_log.tracePoint("Global.test35GlobalAction():" + _cnt + " - 
Test35");
+      return new Forward("goBack");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "gotoPg2",
+                path = "/returnTo/test36/Jsp2.jsp") 
+        })
+   public Forward test36GlobalAction()
+      {
+          //_log.tracePoint("Global.test36GlobalAction():" + _cnt + " - 
Test36");
+      return new Forward("gotoPg2");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "goBack",
+                navigateTo = Jpf.NavigateTo.currentPage) 
+        })
+   public Forward test39GlobalAction()
+      {
+          //_log.tracePoint("Global.test39GlobalAction():" + _cnt + " - 
Test39");
+      return new Forward("goBack");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "gotoPg2",
+                path = "/returnTo/test40/Jsp2.jsp") 
+        })
+   public Forward test40GlobalAction()
+      {
+      //_log.tracePoint("Global.test40GlobalAction():" + _cnt + " - Test40");
+      return new Forward("gotoPg2");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "goBack",
+                navigateTo = Jpf.NavigateTo.currentPage) 
+        })
+   public Forward test40GlobalAction_B()
+      {
+      //_log.tracePoint("Global.test40GlobalAction_B():" + _cnt + " - Test40");
+      return new Forward("goBack");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "goBack",
+                navigateTo = Jpf.NavigateTo.previousAction) 
+        })
+   public Forward test45GlobalAction()
+      {
+      //_log.tracePoint("Global.test45GlobalAction():" + _cnt + " - Test45");
+      return new Forward("goBack");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "gotoAct2",
+                path = "/returnTo/test46/action2.do") 
+        })
+   public Forward test46GlobalAction()
+      {
+      //_log.tracePoint("Global.test46GlobalAction():" + _cnt + " - Test46");
+      if (_toggle == true)
+         {
+         _toggle = false;
+         return new Forward("gotoAct2");
+         }
+      _toggle = true;
+      return new Forward("gotoError");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "goBack",
+                navigateTo = Jpf.NavigateTo.previousAction) 
+        })
+   public Forward test48GlobalAction(FormA inForm)
+//   public Forward test48GlobalAction()
+      {
+      //_log.tracePoint("Global.test48GlobalAction(FormA):"
+      //                  + _cnt
+      //                  + " - Test48 - FormA instance:"
+      //                   + _log.getClassCnter(inForm));
+      return new Forward("goBack");
+      }
+
+    @Jpf.Action(
+        )
+   public Forward unKnown()
+      {
+      ActionMapping mapping = getMapping();
+      //_log.tracePoint("Global.unKnown():"
+      //                  + _cnt
+      //                  + " - Parameter:"
+      //                  + mapping.getParameter());
+      return new Forward("gotoError");
+      }
+
+   /**
+    * StrutsMergeTest2 will raise this "unHandledAction" action.  The forward
+    * "jpf:gotoAction1" below will be overridden by the "struts-merge"
+    * annotation above and send control back to a valid action in the
+    * StrutsMergeTest2 pageflow.
+    */
+    @Jpf.Action(
+        )
+   public Forward unHandledAction()
+      {
+      ActionMapping mapping = getMapping();
+      //_log.tracePoint("Global.unHandledAction():"
+      //                  + _cnt
+      //                  + " - Parameter:"
+      //                  + mapping.getParameter());
+      return new Forward("gotoAction1");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "gotoResults",
+                path = "/miscJpf/bug30448/jpfReturn1.do") 
+        })
+   public Forward jpfReturn1(FormA inForm)
+      {
+      //_log.tracePoint("Global.jpfReturn1(FormA):" + _cnt + " - bug30448");
+      return new Forward("gotoResults");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "/scopedJpf/jpfTest5/jpf1/Jpf1.jpf") 
+        })
+   public Forward jpf1Begin()
+      {
+      //_log.tracePoint("Global.jpf1Begin():" + _cnt + " - JpfTest5");
+      return new Forward("success");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "/scopedJpf/jpfTest5/jpf2/Jpf2.jpf") 
+        })
+   public Forward jpf2Begin()
+      {
+      //_log.tracePoint("Global.jpf2Begin():" + _cnt + " - JpfTest5");
+      return new Forward("success");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "/scopedJpf/jpfTest5/jpf1/goNested.do") 
+        })
+   public Forward jpf1GoNested(FormA form)
+      {
+      //_log.tracePoint("Global.jpf1GoNested(FormA):" + _cnt + " - JpfTest5");
+      return new Forward("success");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "/scopedJpf/jpfTest5/jpf2/goNested.do") 
+        })
+   public Forward jpf2GoNested(FormA form)
+      {
+      //_log.tracePoint("Global.jpf2GoNested(FormA):" + _cnt + " - JpfTest5");
+      return new Forward("success");
+      }
+
+    @Jpf.Action(
+        forwards = {
+            @Jpf.Forward(
+                name = "success",
+                path = "/singletonJpf/jpfTest10/jpf1/jpf1.jpf") 
+        })
+   public Forward gblJpfTest10()
+      {
+      //_log.tracePoint("Global.jpfTest10():" + _cnt + " - JpfTest10");
+      return new Forward("success");
+      }
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(
+                name="success",
+                navigateTo=Jpf.NavigateTo.currentPage
+            )
+        }
+    )
+
+    public Forward pageFlowCore_sharedFlow_globalAction()
+    {
+        return new Forward( "success", "message", "hit globalAction" );
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/mockportal.tld
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/mockportal.tld   
    Fri Aug 13 23:06:05 2004
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 
1.2//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd";>
+
+<taglib>
+    <tlib-version>1.0</tlib-version>
+    <jsp-version>1.1</jsp-version>
+    <short-name>mockportal</short-name>
+    <uri>mockportal</uri>
+    <description>Dummy portal tags, for testing</description>
+    <tag>
+        <name>mockPortlet</name>
+        <tag-class>mockportal.MockPortletTag</tag-class>
+        <description>A simulated portlet.</description>
+        <attribute>
+            <name>portletID</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>pageFlowURI</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>strutsModulePath</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>listenTo</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>verbose</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>mockPortal</name>
+        <tag-class>mockportal.MockPortalTag</tag-class>
+        <description>A simulated portal.</description>
+    </tag>
+</taglib>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/cellrepeatererror/index.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/cellrepeatererror/index.jsp
      (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/cellrepeatererror/index.jsp
      Fri Aug 13 23:06:05 2004
@@ -71,7 +71,7 @@
 <%}catch(Exception e){out.write(HtmlExceptionFormatter.format("Expected 
failure, columns < 0", e, false));}%>
 <hr/>
 <% try{ %>
-<netui-data:cellRepeater dataSource="globalApp.noCellRepeaterProperty" 
rows="-42" columns="5">
+<netui-data:cellRepeater dataSource="sharedFlow.noCellRepeaterProperty" 
rows="-42" columns="5">
     Item: <netui-html:span value="${container.item}"/>
 </netui-data:cellRepeater>
 <%}catch(Exception e){out.write(HtmlExceptionFormatter.format("Expected 
failure, rows < 0", e, false));}%>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/globalApp/nojpf/index.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/globalApp/nojpf/index.jsp
        (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/globalApp/nojpf/index.jsp
        Fri Aug 13 23:06:05 2004
@@ -10,7 +10,7 @@
     <b>Global App Binding -- no JPF</b>
 <br/>
 <br/>
-The Global.app says: <netui:span value="${globalApp.sayHello}"/>
+The Global.app says: <netui:span value="${sharedFlow.sayHello}"/>
 <br/>
 <br/>
   </body>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/interOp/test2/Controller1/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/interOp/test2/Controller1/Jpf1.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/interOp/test2/Controller1/Jpf1.jpf
   Fri Aug 13 23:06:05 2004
@@ -10,8 +10,6 @@
 @Jpf.Controller
 public class Jpf1 extends PageFlowController
 {
-    protected global.Global ga; //= new global.Global();
-
     /**
      * @jpf:action
      * @jpf:forward name="jpf1.jsp" path="Jpf1.jsp"

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Begin.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Begin.jsp
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Begin.jsp
 Fri Aug 13 23:06:05 2004
@@ -6,12 +6,12 @@
 <netui:body>
 <h4>Basic Binding to Global App</h4>
 <p style="color:green">
-This test is a basic test of binding to the GlobalApp.  It binds to the 
<b>appState</b>  and <b>appInfo</b> properties
+This test is a basic test of binding to the SharedFlow.  It binds to the 
<b>appState</b>  and <b>appInfo</b> properties
 in the global app in two different ways.  The first is a direct binding 
through the EL.  The second
 binding is done the page flow.  The page flow exposes a a property that passes 
through the property
 on the global app.  This is a single page test.
 </p>
-App State: <netui:span value="${globalApp.appState}"/><br>
+App State: <netui:span value="${sharedFlow.appState}"/><br>
 App State through page flow: <netui:span value="${pageFlow.appInfo}"/>
 </netui:body>
 </netui:html>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Controller.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Controller.jpf
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appState/Controller.jpf
    Fri Aug 13 23:06:05 2004
@@ -24,10 +24,11 @@
 @Jpf.Controller
 public class Controller extends PageFlowController
 {
-    protected transient global.Global globalApp;
+    @Jpf.SharedFlowField
+    protected transient webappRoot.SharedFlow _sharedFlow;
 
     public String getAppInfo() {
-           return globalApp.getAppInfo();
+           return _sharedFlow.getAppInfo();
     }
 
     @Jpf.Action(

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Begin.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Begin.jsp
     (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Begin.jsp
     Fri Aug 13 23:06:05 2004
@@ -6,7 +6,7 @@
 <body>
 <h4>Pass State betweeen page flows groups</h4>
 <p style="color:green">
-This test passing state between page flows using the globalApp.  Each action 
will append state to the globalApp.getPageFlowState
+This test passing state between page flows using the SharedFlow.  Each action 
will append state to the sharedFlow.getPageFlowState
 property.  Then a nested page flow is called and will display the same state 
variable.  The nested page flow will return
 to the action or page.  These are different page flow actions.   
 </p>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Controller.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Controller.jpf
        (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/Controller.jpf
        Fri Aug 13 23:06:05 2004
@@ -111,9 +111,10 @@
 )
 public class Controller extends PageFlowController
 {
-    protected transient global.Global globalApp;
+    @Jpf.SharedFlowField
+    protected transient webappRoot.SharedFlow _sharedFlow;
     public String getState() {
-           return globalApp.getPageFlowState();
+           return _sharedFlow.getPageFlowState();
     }
 
     @Jpf.Action(
@@ -124,7 +125,7 @@
         })
     public Forward nest()
     {
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>nest");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>nest");
         return new Forward("nest");
     }
 
@@ -138,7 +139,7 @@
     {
         HttpSession session = getSession();
         session.setAttribute("pageFlow",this);
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>returnToPage");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>returnToPage");
         return new Forward("begin");
     }
 
@@ -152,7 +153,7 @@
     {
         HttpSession session = getSession();
         session.setAttribute("pageFlow",this);
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>returnToAction");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>returnToAction");
         return new Forward("begin");
     }
 
@@ -164,7 +165,7 @@
         })
     public Forward begin()
     {
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>begin");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>begin");
         return new Forward("begin");
     }
 }

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/nested/Controller.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/nested/Controller.jpf
 (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/appStatePass/nested/Controller.jpf
 Fri Aug 13 23:06:05 2004
@@ -101,10 +101,11 @@
 )
 public class Controller extends PageFlowController
 {
-    protected transient global.Global globalApp;
+    @Jpf.SharedFlowField
+    protected transient webappRoot.SharedFlow _sharedFlow;
     
     public String getState() {
-        return globalApp.getPageFlowState();
+        return _sharedFlow.getPageFlowState();
     }
 
     @Jpf.Action(
@@ -117,7 +118,7 @@
     {
         HttpSession session = getSession();
         session.setAttribute("pageFlow",this);
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>[nested]nestOne");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>[nested]nestOne");
         return new Forward("return");
     }
 
@@ -131,7 +132,7 @@
     {
         HttpSession session = getSession();
         session.setAttribute("pageFlow",this);
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>[nested]nestTwo");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>[nested]nestTwo");
         return new Forward("return");
     }
 
@@ -145,7 +146,7 @@
     {
         HttpSession session = getSession();
         session.setAttribute("pageFlow",this);
-        globalApp.setPageFlowState(globalApp.getPageFlowState() + "<br 
/>[nested]begin");
+        _sharedFlow.setPageFlowState(_sharedFlow.getPageFlowState() + "<br 
/>[nested]begin");
         return new Forward("begin");
     }
 }

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Begin.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Begin.jsp
        (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Begin.jsp
        Fri Aug 13 23:06:05 2004
@@ -8,8 +8,8 @@
 <body>
 <h4>Lifecycle</h4>
 <p style="color:green">
-This test will create appends a value to a global variable stored in the 
globalApp for each lifecycle event.
-When you go to the results page, it will call an action in globalApp which 
will forward to the <b>results/Controller.jpf</b> which
+This test will create appends a value to a global variable stored in the 
sharedFlow for each lifecycle event.
+When you go to the results page, it will call an action in sharedFlow which 
will forward to the <b>results/Controller.jpf</b> which
 displays that global variable.
 </p>
 <netui:anchor action="postback">Postback</netui:anchor>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Controller.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Controller.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/lifecycle/Controller.jpf
   Fri Aug 13 23:06:05 2004
@@ -76,10 +76,11 @@
         
         System.err.println("inside onDestroy [lifecycle]");
         _lifecycle += "onDestroy<br />";
-        globalApp.setResults(_lifecycle);
+        _sharedFlow.setResults(_lifecycle);
     }
 
-    protected transient global.Global globalApp;
+    @Jpf.SharedFlowField
+    protected transient webappRoot.SharedFlow _sharedFlow;
 
     String _lifecycle = "";
     public String getLifecycle() {

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug30448/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug30448/Jpf1.jpf
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug30448/Jpf1.jpf
    Fri Aug 13 23:06:05 2004
@@ -373,7 +373,6 @@
     })
 public class Jpf1 extends PageFlowController
     {
-    protected global.Global       globalApp;
     public static final  String   FLD1_VALUE  = "Jpf1 Fld1 Value";
     public static final  String   FLD2_VALUE  = "Jpf1 Fld2 Value";
 

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfGlobalApp/Controller.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfGlobalApp/Controller.jpf
      (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/pfGlobalApp/Controller.jpf
      Fri Aug 13 23:06:05 2004
@@ -55,11 +55,12 @@
 @Jpf.Controller
 public class Controller extends PageFlowController
 {
-    protected transient global.Global globalApp;
+    @Jpf.SharedFlowField
+    protected transient webappRoot.SharedFlow _sharedFlow;
 
     public String getGlobalAppInfo()
     {
-        return globalApp.getGlobalAppInfo();
+        return _sharedFlow.getGlobalAppInfo();
     }
 
     @Jpf.Action(

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/HasNoSharedFlow.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/HasNoSharedFlow.jpf
  Fri Aug 13 23:06:05 2004
@@ -0,0 +1,49 @@
+package pageFlowCore.sharedFlow;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]@Jpf.ViewProperties( value={
+    "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",
+    "<view-properties>",
+    "    <pageflow-object 
id='pageflow:/sharedFlow/SharedFlowController.jpf'/>",
+    "    <pageflow-object id='action:begin.do'>",
+    "        <property value='80' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='page:index.jsp'>",
+    "        <property value='220' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'>",
+    "        <property value='116,140,140,164' name='elbowsX'/>",
+    "        <property value='92,92,92,92' name='elbowsY'/>",
+    "        <property value='East_1' name='fromPort'/>",
+    "        <property value='West_1' name='toPort'/>",
+    "        <property value='index' name='label'/>",
+    "    </pageflow-object>",
+    "</view-properties>"})
+public class HasNoSharedFlow extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private webappRoot.SharedFlow _sharedFlow;;
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    public String getSharedFlowField()
+    {
+        return _sharedFlow.getDisplayName();
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf
    Fri Aug 13 23:06:05 2004
@@ -0,0 +1,49 @@
+package pageFlowCore.sharedFlow.hasSharedFlow1;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]@Jpf.ViewProperties( value={
+    "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",
+    "<view-properties>",
+    "    <pageflow-object 
id='pageflow:/sharedFlow/SharedFlowController.jpf'/>",
+    "    <pageflow-object id='action:begin.do'>",
+    "        <property value='80' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='page:index.jsp'>",
+    "        <property value='220' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'>",
+    "        <property value='116,140,140,164' name='elbowsX'/>",
+    "        <property value='92,92,92,92' name='elbowsY'/>",
+    "        <property value='East_1' name='fromPort'/>",
+    "        <property value='West_1' name='toPort'/>",
+    "        <property value='index' name='label'/>",
+    "    </pageflow-object>",
+    "</view-properties>"})
+public class HasSharedFlow1 extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private SharedFlow1 sf;
+    
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    public String getSharedFlowField()
+    {
+        return sf.getDisplayName();
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/SharedFlow1.jpfs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/SharedFlow1.jpfs
      Fri Aug 13 23:06:05 2004
@@ -0,0 +1,23 @@
+package pageFlowCore.sharedFlow.hasSharedFlow1;
+
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED]
+public class SharedFlow1 extends SharedFlowController
+{
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(
+                name="success",
+                navigateTo=Jpf.NavigateTo.currentPage
+            )
+        }
+    )
+    public Forward sharedFlow1Action()
+    {
+        return new Forward( "success", "message", "hit SharedFlow1.jpfs" );
+    }
+
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/index.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/index.jsp
     Fri Aug 13 23:06:05 2004
@@ -0,0 +1,27 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+
+
+<netui:html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><netui:label value="${pageInput.message}"/></b>
+        <br/>
+        SharedFlowController field: <b><netui:label 
value="${pageFlow.sharedFlowField}"/></b>
+        <br/>
+        <br/>
+        <netui:anchor 
action="sharedFlow1Action">sharedFlow1Action</netui:anchor>
+        <br/>
+        <netui:anchor 
href="seesSharedFlow1/SeesSharedFlow1.jpf">seesSharedFlow1/SeesSharedFlow1.jpf</netui:anchor>
+
+ 
+    </body>
+</netui:html>
+
+  

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf
   Fri Aug 13 23:06:05 2004
@@ -0,0 +1,50 @@
+package pageFlowCore.sharedFlow.hasSharedFlow1.seesSharedFlow1;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import pageFlowCore.sharedFlow.hasSharedFlow1.SharedFlow1;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]@Jpf.ViewProperties( value={
+    "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",
+    "<view-properties>",
+    "    <pageflow-object 
id='pageflow:/sharedFlow/SharedFlowController.jpf'/>",
+    "    <pageflow-object id='action:begin.do'>",
+    "        <property value='80' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='page:index.jsp'>",
+    "        <property value='220' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'>",
+    "        <property value='116,140,140,164' name='elbowsX'/>",
+    "        <property value='92,92,92,92' name='elbowsY'/>",
+    "        <property value='East_1' name='fromPort'/>",
+    "        <property value='West_1' name='toPort'/>",
+    "        <property value='index' name='label'/>",
+    "    </pageflow-object>",
+    "</view-properties>"})
+public class SeesSharedFlow1 extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private SharedFlow1 sf;
+    
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    public String getSharedFlowField()
+    {
+        return sf.getDisplayName();
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf
     Fri Aug 13 23:06:05 2004
@@ -0,0 +1,51 @@
+package pageFlowCore.sharedFlow.hasSharedFlow1.seesSharedFlow1.hasSharedFlow2;
+
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]@Jpf.ViewProperties( value={
+    "<!-- This data is auto-generated. Hand-editing this section is not 
recommended. -->",
+    "<view-properties>",
+    "    <pageflow-object 
id='pageflow:/sharedFlow/SharedFlowController.jpf'/>",
+    "    <pageflow-object id='action:begin.do'>",
+    "        <property value='80' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='page:index.jsp'>",
+    "        <property value='220' name='x'/>",
+    "        <property value='100' name='y'/>",
+    "    </pageflow-object>",
+    "    <pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'>",
+    "        <property value='116,140,140,164' name='elbowsX'/>",
+    "        <property value='92,92,92,92' name='elbowsY'/>",
+    "        <property value='East_1' name='fromPort'/>",
+    "        <property value='West_1' name='toPort'/>",
+    "        <property value='index' name='label'/>",
+    "    </pageflow-object>",
+    "</view-properties>"})
+public class HasSharedFlow2 extends PageFlowController
+{
+    @Jpf.SharedFlowField
+    private SharedFlow2 sf;
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+
+    public String getSharedFlowField()
+    {
+        return sf.getDisplayName();
+    }
+
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/SharedFlow2.jpfs
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/SharedFlow2.jpfs
       Fri Aug 13 23:06:05 2004
@@ -0,0 +1,23 @@
+package pageFlowCore.sharedFlow.hasSharedFlow1.seesSharedFlow1.hasSharedFlow2;
+
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED]
+public class SharedFlow2 extends SharedFlowController
+{
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(
+                name="success",
+                navigateTo=Jpf.NavigateTo.currentPage
+            )
+        }
+    )
+    public Forward sharedFlow2Action()
+    {
+        return new Forward( "success", "message", "hit SharedFlow2.jpfs" );
+    }
+
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/index.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/index.jsp
      Fri Aug 13 23:06:05 2004
@@ -0,0 +1,24 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+
+
+<netui:html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><netui:label value="${pageInput.message}"/></b>
+        <br/>
+        SharedFlowController field: <b><netui:label 
value="${pageFlow.sharedFlowField}"/></b>
+        <br/>
+        <br/>
+        <netui:anchor 
action="sharedFlow2Action">sharedFlow2Action</netui:anchor>
+ 
+    </body>
+</netui:html>
+
+  

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/index.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/index.jsp
     Fri Aug 13 23:06:05 2004
@@ -0,0 +1,26 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+
+
+<netui:html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><netui:label value="${pageInput.message}"/></b>
+        <br/>
+        SharedFlowController field: <b><netui:label 
value="${pageFlow.sharedFlowField}"/></b>
+        <br/>
+        <br/>
+        <netui:anchor 
action="sharedFlow1Action">sharedFlow1Action</netui:anchor>
+        <br/>
+        <netui:anchor 
href="hasSharedFlow2/HasSharedFlow2.jpf">hasSharedFlow2/HasSharedFlow2.jpf</netui:anchor>
+ 
+    </body>
+</netui:html>
+
+  

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/index.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/sharedFlow/index.jsp
    Fri Aug 13 23:06:05 2004
@@ -0,0 +1,25 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+
+
+<netui:html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><netui:label value="${pageInput.message}"/></b>
+        <br/>
+        SharedFlow field: <b><netui:label 
value="${pageFlow.sharedFlowField}"/></b>
+        <br/>
+        <br/>
+        <netui:anchor 
action="pageFlowCore_sharedFlow_globalAction">pageFlowCore_sharedFlow_globalAction</netui:anchor>
+        <br/>
+        <netui:anchor 
href="hasSharedFlow1/HasSharedFlow1.jpf">hasSharedFlow1/HasSharedFlow1.jpf</netui:anchor>
+    </body>
+</netui:html>
+
+  

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/results/Begin.jsp
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/results/Begin.jsp    
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/results/Begin.jsp    
Fri Aug 13 23:06:05 2004
@@ -8,11 +8,11 @@
 <body>
 <h2>results</h2>
 <p style="color:green">
-This displays the contents of the global property <b>globalApp.results</b>.  
The Lifecycle test calls this PageFlow through
-the globalApp so that is can capture the onDestroy event within the lifecycle.
+This displays the contents of the global property <b>sharedFlow.results</b>.  
The Lifecycle test calls this PageFlow through
+the sharedFlow so that is can capture the onDestroy event within the lifecycle.
 </p>
 <hr />
-<netui:content value="${globalApp.results}"/>
+<netui:content value="${sharedFlow.results}"/>
 <hr />
 </body>
 </html>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test2/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test2/Jpf1.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test2/Jpf1.jpf
   Fri Aug 13 23:06:05 2004
@@ -8,8 +8,6 @@
 @Jpf.Controller
 public class Jpf1 extends PageFlowController
     {
-    protected transient global.Global globalApp;
-
     /**
      * @jpf:action
      * @jpf:forward name="gotoPg1" path="Jsp1.jsp"

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test3/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test3/Jpf1.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test3/Jpf1.jpf
   Fri Aug 13 23:06:05 2004
@@ -12,7 +12,6 @@
     strutsMerge = "/strutsMerge/test3/merge-jpf-struts-config.xml")
 public class Jpf1 extends PageFlowController
     {
-    protected transient global.Global globalApp;
     private static final String TEST_STR = "Test Value";
 
     /**

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test4/Jpf1.jpf
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test4/Jpf1.jpf
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test4/Jpf1.jpf
   Fri Aug 13 23:06:05 2004
@@ -12,7 +12,6 @@
     strutsMerge = "/strutsMerge/test4/merge-jpf-struts-config.xml")
 public class Jpf1 extends PageFlowController
     {
-    protected transient global.Global globalApp;
 
     /**
      * @jpf:action

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
   Fri Aug 13 23:06:05 2004
@@ -3548,6 +3548,20 @@
          </features>
       </test>
       <test>
+         <name>pfSharedFlow</name>
+         <description>Tests shared flow features.</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>drt</category>
+            <category>bvt</category>
+            <category>corePageFlow</category>
+         </categories>
+         <features>
+            <feature>PageFlow</feature>
+            <feature>SharedFlow</feature>
+         </features>
+      </test>
+      <test>
          <name>PfSingleton</name>
          <description>Test singleton page flows and frames 
support</description>
          <webapp>coreWeb</webapp>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppState.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppState.xml  
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppState.xml  
    Fri Aug 13 23:06:05 2004
@@ -59,7 +59,7 @@
 <body>
 <h4>Basic Binding to Global App</h4>
 <p style="color:green">
-This test is a basic test of binding to the GlobalApp.  It binds to the 
<b>appState</b>  and <b>appInfo</b> properties
+This test is a basic test of binding to the SharedFlow.  It binds to the 
<b>appState</b>  and <b>appInfo</b> properties
 in the global app in two different ways.  The first is a direct binding 
through the EL.  The second
 binding is done the page flow.  The page flow exposes a a property that passes 
through the property
 on the global app.  This is a single page test.

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppStatePass.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppStatePass.xml
  (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/AppStatePass.xml
  Fri Aug 13 23:06:05 2004
@@ -82,7 +82,7 @@
 <body>
 <h4>Pass State betweeen page flows groups</h4>
 <p style="color:green">
-This test passing state between page flows using the globalApp.  Each action 
will append state to the globalApp.getPageFlowState
+This test passing state between page flows using the SharedFlow.  Each action 
will append state to the sharedFlow.getPageFlowState
 property.  Then a nested page flow is called and will display the same state 
variable.  The nested page flow will return
 to the action or page.  These are different page flow actions.   
 </p>
@@ -260,7 +260,7 @@
 <body>
 <h4>Pass State betweeen page flows groups</h4>
 <p style="color:green">
-This test passing state between page flows using the globalApp.  Each action 
will append state to the globalApp.getPageFlowState
+This test passing state between page flows using the SharedFlow.  Each action 
will append state to the sharedFlow.getPageFlowState
 property.  Then a nested page flow is called and will display the same state 
variable.  The nested page flow will return
 to the action or page.  These are different page flow actions.   
 </p>
@@ -438,7 +438,7 @@
 <body>
 <h4>Pass State betweeen page flows groups</h4>
 <p style="color:green">
-This test passing state between page flows using the globalApp.  Each action 
will append state to the globalApp.getPageFlowState
+This test passing state between page flows using the SharedFlow.  Each action 
will append state to the sharedFlow.getPageFlowState
 property.  Then a nested page flow is called and will display the same state 
variable.  The nested page flow will return
 to the action or page.  These are different page flow actions.   
 </p>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CellRepeaterError2.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CellRepeaterError2.xml
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CellRepeaterError2.xml
    Fri Aug 13 23:06:05 2004
@@ -120,7 +120,7 @@
  <th>Errors</th><td colspan="2">1</td></tr>
  <tr><th>Expression Error</th><th>Attribute</th><td>dataSource</td>
  <th>Expression</th><td>{globalApp.noCellRepeaterProperty}</td></tr>
- <tr><th valign="top">Message</th><td colspan="4">Caught exception when 
evaluating expression "{globalApp.noCellRepeaterProperty}" with available 
binding contexts [actionForm, pageFlow, globalApp, request, session, 
application, pageContext, bundle, container, url, pageInput]. Root cause: 
java.lang.RuntimeException: Could not find property or field 
"noCellRepeaterProperty" on object of type "class global.Global"</td></tr>
+ <tr><th valign="top">Message</th><td colspan="4">Caught exception when 
evaluating expression "{globalApp.noCellRepeaterProperty}" with available 
binding contexts [actionForm, pageFlow, globalApp, request, session, 
application, pageContext, bundle, container, url, pageInput]. Root cause: 
java.lang.RuntimeException: Could not find property or field 
"noCellRepeaterProperty" on object of type "class 
webappRoot.SharedFlow"</td></tr>
 </table></span>
 
 

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/Lifecycle.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/Lifecycle.xml 
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/Lifecycle.xml 
    Fri Aug 13 23:06:05 2004
@@ -82,8 +82,8 @@
 <body>
 <h4>Lifecycle</h4>
 <p style="color:green">
-This test will create appends a value to a global variable stored in the 
globalApp for each lifecycle event.
-When you go to the results page, it will call an action in globalApp which 
will forward to the <b>results/Controller.jpf</b> which
+This test will create appends a value to a global variable stored in the 
sharedFlow for each lifecycle event.
+When you go to the results page, it will call an action in sharedFlow which 
will forward to the <b>results/Controller.jpf</b> which
 displays that global variable.
 </p>
 <a href="/coreWeb/miniTests/lifecycle/postback.do">Postback</a>
@@ -174,8 +174,8 @@
 <body>
 <h4>Lifecycle</h4>
 <p style="color:green">
-This test will create appends a value to a global variable stored in the 
globalApp for each lifecycle event.
-When you go to the results page, it will call an action in globalApp which 
will forward to the <b>results/Controller.jpf</b> which
+This test will create appends a value to a global variable stored in the 
sharedFlow for each lifecycle event.
+When you go to the results page, it will call an action in sharedFlow which 
will forward to the <b>results/Controller.jpf</b> which
 displays that global variable.
 </p>
 <a href="/coreWeb/miniTests/lifecycle/postback.do">Postback</a>
@@ -266,8 +266,8 @@
 <body>
 <h2>results</h2>
 <p style="color:green">
-This displays the contents of the global property <b>globalApp.results</b>.  
The Lifecycle test calls this PageFlow through
-the globalApp so that is can capture the onDestroy event within the lifecycle.
+This displays the contents of the global property <b>sharedFlow.results</b>.  
The Lifecycle test calls this PageFlow through
+the sharedFlow so that is can capture the onDestroy event within the lifecycle.
 </p>
 <hr />
 onCreate<br />beforeAction<br />begin<br />afterAction<br />beforeAction<br 
/>postback<br />afterAction<br />onDestroy<br />onDestroy<br />

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfGlobalApp.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfGlobalApp.xml
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfGlobalApp.xml
   Fri Aug 13 23:06:05 2004
@@ -161,7 +161,7 @@
 <h4>PageFlow Global Info</h4>
 <a href="/coreWeb/pageFlowCore/pfGlobalApp/globalAction_getInfo.do">Get Global 
Info</a>
 <hr />
-<table border='1' 
cellspacing='0'cellpaddinig='2'><tr><td>Request</td><td>/coreWeb/-global/globalAction_getInfo.do</td></tr><tr><td>Response</td><td>Committed:false</td></tr><tr><td>Session</td><td>In
 active 
interval:3600</td></tr><tr><td>Nestable</td><td>false</td></tr><tr><td>PageFlow</td><td>false</td></tr><tr><td>Actions</td><td>gblJpfTest10<br
 />globalAction<br />globalAction_action<br />globalAction_form<br 
/>globalAction_getInfo<br />globalAction_results<br />globalReturnToAction<br 
/>globalReturnToCurrentPage<br />globalReturnToCurrentPageOverrideForm<br 
/>globalReturnToCurrentPageOverrideInputs<br 
/>globalReturnToCurrentPageWithForm<br />globalReturnToPage<br 
/>globalReturnToPageOverrideForm<br />globalReturnToPageOverrideInputs<br 
/>globalReturnToPageWithForm<br />globalReturnToPreviousAction<br 
/>globalReturnToPreviousPage<br />globalReturnToPreviousPageOverrideForm<br 
/>globalReturnToPreviousPageOverrideInputs<br />jpf1Begin<br />jpf1GoNested<br 
/>jpf2Begin<br />jpf2GoNested<br />jpfReturn1<br />test35GlobalAction<br 
/>test36GlobalAction<br />test39GlobalAction<br />test40GlobalAction<br 
/>test40GlobalAction_B<br />test45GlobalAction<br />test46GlobalAction<br 
/>test48GlobalAction<br />toLegacy<br />unHandledAction<br />unKnown<br 
/></td></tr><tr><td>ActionMapping</td><td>ActionConfig[path=/globalAction_getInfo,name=globalForm,scope=request,type=global.Global</td></tr><tr><td>URI</td><td>/</td></tr><tr><td>parentDir</td><td>/-global</td></tr></table>
+<table border='1' 
cellspacing='0'cellpaddinig='2'><tr><td>Request</td><td>/coreWeb/-webappRoot/globalAction_getInfo.do</td></tr><tr><td>Response</td><td>Committed:false</td></tr><tr><td>Session</td><td>In
 active 
interval:3600</td></tr><tr><td>Nestable</td><td>false</td></tr><tr><td>PageFlow</td><td>false</td></tr><tr><td>Actions</td><td>gblJpfTest10<br
 />globalAction<br />globalAction_action<br />globalAction_form<br 
/>globalAction_getInfo<br />globalAction_results<br />globalReturnToAction<br 
/>globalReturnToCurrentPage<br />globalReturnToCurrentPageOverrideForm<br 
/>globalReturnToCurrentPageOverrideInputs<br 
/>globalReturnToCurrentPageWithForm<br />globalReturnToPage<br 
/>globalReturnToPageOverrideForm<br />globalReturnToPageOverrideInputs<br 
/>globalReturnToPageWithForm<br />globalReturnToPreviousAction<br 
/>globalReturnToPreviousPage<br />globalReturnToPreviousPageOverrideForm<br 
/>globalReturnToPreviousPageOverrideInputs<br />jpf1Begin<br />jpf1GoNested<br 
/>jpf2Begin<br />jpf2GoNested<br />jpfReturn1<br 
/>pageFlowCore_sharedFlow_globalAction<br />test35GlobalAction<br 
/>test36GlobalAction<br />test39GlobalAction<br />test40GlobalAction<br 
/>test40GlobalAction_B<br />test45GlobalAction<br />test46GlobalAction<br 
/>test48GlobalAction<br />toLegacy<br />unHandledAction<br />unKnown<br 
/></td></tr><tr><td>ActionMapping</td><td>ActionConfig[path=/globalAction_getInfo,name=globalForm,scope=request,type=webappRoot.SharedFlow</td></tr><tr><td>URI</td><td>/</td></tr><tr><td>parentDir</td><td>/-webappRoot</td></tr></table>
 </body>
 </html>]]></ses:responseBody>
          </ses:response>

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfSharedFlow.xml
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PfSharedFlow.xml
  Fri Aug 13 23:06:05 2004
@@ -0,0 +1,675 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>PfSharedFlow</ses:sessionName>
+   <ses:tester>rich</ses:tester>
+   <ses:startDate>13 Aug 2004, 12:41:23.372 PM MDT</ses:startDate>
+   <ses:description>Test of basic Shared Flow features: action bubbling and 
initialization of fields marked with @Jpf.SharedFlowField.</ses:description>
+   <ses:tests>
+      <ses:test>
+         <ses:testNumber>1</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/HasNoSharedFlow.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label></label></b>
+        <br/>
+        SharedFlow field: <b><label>webappRoot.SharedFlow</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/pageFlowCore_sharedFlow_globalAction.do">pageFlowCore_sharedFlow_globalAction</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf">hasSharedFlow1/HasSharedFlow1.jpf</a>
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>2</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/pageFlowCore_sharedFlow_globalAction.do</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/HasNoSharedFlow.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label>hit globalAction</label></b>
+        <br/>
+        SharedFlow field: <b><label>webappRoot.SharedFlow</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/pageFlowCore_sharedFlow_globalAction.do">pageFlowCore_sharedFlow_globalAction</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf">hasSharedFlow1/HasSharedFlow1.jpf</a>
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>3</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/pageFlowCore_sharedFlow_globalAction.do</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label></label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.SharedFlow1</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/sharedFlow1Action.do">sharedFlow1Action</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf">seesSharedFlow1/SeesSharedFlow1.jpf</a>
+
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>4</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/sharedFlow1Action.do</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/HasSharedFlow1.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label>hit SharedFlow1.jpfs</label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.SharedFlow1</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/sharedFlow1Action.do">sharedFlow1Action</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf">seesSharedFlow1/SeesSharedFlow1.jpf</a>
+
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>5</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/sharedFlow1Action.do</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label></label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.SharedFlow1</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/sharedFlow1Action.do">sharedFlow1Action</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf">hasSharedFlow2/HasSharedFlow2.jpf</a>
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>6</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/sharedFlow1Action.do</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/SeesSharedFlow1.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label>hit SharedFlow1.jpfs</label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.SharedFlow1</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/sharedFlow1Action.do">sharedFlow1Action</a>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf">hasSharedFlow2/HasSharedFlow2.jpf</a>
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>7</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/sharedFlow1Action.do</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label></label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.seesSharedFlow1.hasSharedFlow2.SharedFlow2</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/sharedFlow2Action.do">sharedFlow2Action</a>
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>8</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/sharedFlow2Action.do</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=F341DA6C104E7BE2B2B872D956A47A35</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/HasSharedFlow2.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7) Gecko/20040707 Firefox/0.9.2</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+        <base 
href="http://localhost:8080/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/index.jsp";>
+    </head>
+    <body>
+        <h3>Shared Flow Test</h3>
+
+        message: <b><label>hit SharedFlow2.jpfs</label></b>
+        <br/>
+        SharedFlowController field: 
<b><label>pageFlowCore.sharedFlow.hasSharedFlow1.seesSharedFlow1.hasSharedFlow2.SharedFlow2</label></b>
+        <br/>
+        <br/>
+        <a 
href="/coreWeb/pageFlowCore/sharedFlow/hasSharedFlow1/seesSharedFlow1/hasSharedFlow2/sharedFlow2Action.do">sharedFlow2Action</a>
+ 
+    </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>13 Aug 2004, 12:41:41.839 PM MDT</ses:endDate>
+   <ses:testCount>8</ses:testCount>
+</ses:recorderSession>

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/StrutsInteropTest2.xml
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/StrutsInteropTest2.xml
    (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/StrutsInteropTest2.xml
    Fri Aug 13 23:06:05 2004
@@ -389,4 +389,4 @@
   <testCount>3</testCount>
   <passedCount>2</passedCount>
   <failedCount>1</failedCount>
-</recorderSession>
\ No newline at end of file
+</recorderSession>

Reply via email to