Author: rich
Date: Fri Aug 20 07:26:34 2004
New Revision: 36665

Added:
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
   (contents, props changed)
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
   (contents, props changed)
   
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
   (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/BackingControlsController.jpf
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControl.java
      - copied, changed from rev 36577, 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControl.java
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControlImpl.jcs
      - copied, changed from rev 36577, 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControlImpl.jcs
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsfb
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsp 
  (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/NavigateToController.jpf
   (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsfb  
 (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsp   
(contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsfb  
 (contents, props changed)
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsp   
(contents, props changed)
Modified:
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FacesBackingChecker.java
   
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/JpfLanguageConstants.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/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/internal/InternalUtils.java
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/jpfFaces/page1.jsfb
   
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/startRecord.jsp
   incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/test.jsp
Log:
Enabled automatic initialization of annotated Control member fields in JSF 
backing beans.  Also enabled onCreate() and onDestroy() lifecycle methods.

DRT: netui (WinXP)
BB: self



Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FacesBackingChecker.java
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FacesBackingChecker.java
       (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/FacesBackingChecker.java
       Fri Aug 20 07:26:34 2004
@@ -28,6 +28,7 @@
 import org.apache.beehive.netui.compiler.grammar.CommandHandlerGrammar;
 
 import static 
org.apache.beehive.netui.compiler.JpfLanguageConstants.COMMAND_HANDLER_TAG_NAME;
+import static 
org.apache.beehive.netui.compiler.JpfLanguageConstants.FACES_BACKING_BEAN_CLASS;
 
 
 public class FacesBackingChecker
@@ -40,11 +41,22 @@
     
     public BaseGenerator getGenerator()
     {
-        return null;
+        return new BaseGenerator( getEnv() )
+        {
+            public void generate( ClassDeclaration publicClass )
+            {
+            }
+        };
     }
     
     public Map onCheck( ClassDeclaration jclass )
     {
+        if ( ! CompilerUtils.isAssignableFrom( FACES_BACKING_BEAN_CLASS, 
jclass, getEnv() ))
+        {
+            getDiagnostics().addError( jclass, "error.does-not-extend-base", 
FACES_BACKING_BEAN_CLASS );
+            return null;
+        }
+        
         Collection< ClassDeclaration > packageClasses = 
jclass.getPackage().getClasses();
         ClassDeclaration jpfClass = null;
         

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 20 07:26:34 2004
@@ -74,6 +74,7 @@
     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 + 
".SharedFlowController";
+    public static final String FACES_BACKING_BEAN_CLASS = PAGEFLOW_PACKAGE + 
".FacesBackingBean";
     public static final String FLOW_CONTROLLER_ACTION_CLASS = 
PAGEFLOW_INTERNAL_PACKAGE + ".FlowControllerAction";
     public static final String WEBAPP_ROOT_PACKAGE = "webappRoot";
     public static final String GLOBALAPP_BASE_CLASS = PAGEFLOW_PACKAGE + 
".GlobalApp";

Added: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
  Fri Aug 20 07:26:34 2004
@@ -0,0 +1,50 @@
+/*
+ * 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.beehive.netui.pageflow.internal.InternalConstants;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+public class FacesBackingBean
+        extends PageFlowManagedObject
+{
+    void persistInSession( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
+    {
+        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( 
request );
+        ScopedServletUtils.setScopedSessionAttr( 
InternalConstants.FACES_BACKING_ATTR, this, unwrappedRequest );
+    }
+
+    public void ensureFailover( HttpServletRequest request )
+    {
+        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( 
request );
+        String attr =
+                ScopedServletUtils.getScopedSessionAttrName( 
InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
+        InternalUtils.getServerAdapter().ensureFailover( attr, this, 
unwrappedRequest );
+    }
+
+    void setImplicitObject( HttpServletRequest request )
+    {
+        request.setAttribute( InternalConstants.BACKING_CLASS_IMPLICIT_OBJECT, 
this );
+    }
+}

Added: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
   Fri Aug 20 07:26:34 2004
@@ -0,0 +1,103 @@
+/*
+ * 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 static 
org.apache.beehive.netui.pageflow.internal.InternalConstants.FACES_BACKING_ATTR;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.ContextCache;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
+import org.apache.beehive.netui.util.FileUtils;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+class FacesBackingBeanFactory
+{
+    private static final Logger _log = Logger.getInstance( 
FacesBackingBeanFactory.class );
+    
+    
+    public static FacesBackingBean getFacesBackingBeanForRequest( 
HttpServletRequest request, 
+                                                                  
HttpServletResponse response, 
+                                                                  
ServletContext servletContext )
+    {
+        String relativeURI = PageFlowUtils.getRelativeURI( request, 
InternalUtils.decodeURI( request ), null );
+        assert relativeURI.startsWith( "/" ) : relativeURI;
+        String backingClassName = FileUtils.stripFileExtension( 
relativeURI.substring( 1 ).replace( '/', '.' ) );
+        FacesBackingBean currentBean = InternalUtils.getFacesBackingBean( 
request );
+        
+        if ( currentBean == null || ! currentBean.getClass().getName().equals( 
backingClassName ) )
+        {
+            try
+            {
+                Class backingClass =
+                    ContextCache.get( servletContext 
).getReloadableClassHandler().loadClass( backingClassName, request );
+                
+                if ( backingClass.getAnnotation( Jpf.FacesBacking.class ) != 
null )
+                {
+                    FacesBackingBean bean = ( FacesBackingBean ) 
backingClass.newInstance();
+                    bean.create( request, response, servletContext );
+                    bean.persistInSession( request, response, servletContext );
+                    return bean;
+                }
+                else
+                {
+                    if ( _log.isDebugEnabled() )
+                    {
+                        _log.debug( "Found matching backing class " + 
backingClassName + "for request " 
+                                    + request.getRequestURI() + ", but it does 
not have the "
+                                    + Jpf.FacesBacking.class.getName() + " 
annotation." );
+                    }
+                }
+            }
+            catch ( ClassNotFoundException e )
+            {
+                if ( _log.isTraceEnabled() )
+                {
+                    _log.trace( "No backing bean class " + backingClassName + 
" found for request "
+                                + request.getRequestURI() );
+                }
+            }
+            catch ( InstantiationException e )
+            {
+                _log.error( "Could not create backing bean instance of " + 
backingClassName, e );
+            }
+            catch ( IllegalAccessException e )
+            {
+                _log.error( "Could not create backing bean instance of " + 
backingClassName, e );
+            }
+            catch ( Exception e )
+            {
+                _log.error( "Error while creating backing bean instance of " + 
backingClassName, e );
+            }
+            
+            HttpServletRequest unwrappedRequest = 
PageFlowUtils.unwrapMultipart( request );
+            ScopedServletUtils.removeScopedSessionAttr( FACES_BACKING_ATTR, 
unwrappedRequest );
+            request.getSession().removeAttribute( FACES_BACKING_ATTR );
+        }
+        else if ( currentBean != null )
+        {
+            currentBean.reinitialize( request, response, servletContext );
+        }
+        
+        return currentBean;
+    }
+}

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 20 07:26:34 2004
@@ -22,7 +22,6 @@
 import org.apache.beehive.netui.pageflow.internal.ContextCache;
 import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
 import org.apache.beehive.netui.util.FileUtils;
-import org.apache.beehive.netui.pageflow.internal.JavaControlUtils;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
 import org.apache.beehive.netui.pageflow.handler.LoginHandler;
 import org.apache.beehive.netui.pageflow.handler.ExceptionsHandler;
@@ -40,23 +39,14 @@
 import org.apache.struts.action.ActionServlet;
 import org.apache.struts.config.ActionConfig;
 import org.apache.struts.config.ModuleConfig;
-import org.apache.struts.upload.MultipartRequestWrapper;
-import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.api.context.ControlBeanContext;
-import org.apache.beehive.controls.api.properties.PropertyMap;
 
 import javax.security.auth.login.LoginException;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
 import java.io.IOException;
-import java.io.Serializable;
-import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -67,8 +57,8 @@
 /**
  * Base class for user-written flow controllers - PageFlowControllers and 
Global.app.
  */ 
-public abstract class FlowController
-        implements Serializable, PageFlowConstants, ActionResolver, 
HttpSessionBindingListener
+public abstract class FlowController extends PageFlowManagedObject
+        implements PageFlowConstants, ActionResolver
 {
     private static final Logger _log = Logger.getInstance( 
FlowController.class );
     
@@ -116,11 +106,6 @@
     private transient PerRequestState _perRequestState;
 
     /**
-     * Reference to the current ServletContext.
-     */ 
-    private transient ServletContext _servletContext;
-    
-    /**
      * Cached reference to the associated Struts ModuleConfig.
      */ 
     private transient ModuleConfig _moduleConfig = null;
@@ -142,7 +127,17 @@
     protected FlowController()
     {
     }
-    
+
+    public void reinitialize( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
+    {
+        //
+        // Cache the associated ModuleConfig.  This is used throughout the 
code, in places where the request
+        // isn't available to do a lazy initialization.
+        //
+        initModuleConfig( servletContext, request );
+        super.reinitialize( request, response, servletContext );
+    }
+
     /**
      * Log in the user, using "weak" username/password authentication.
      *
@@ -496,7 +491,7 @@
                 //
                 // Store information on this action for use with 
navigateTo=Jpf.NavigateTo.previousAction.
                 //
-                savePreviousActionInfo( form, request, mapping, 
getServlet().getServletContext() );
+                savePreviousActionInfo( form, request, mapping, 
getServletContext() );
                 
                 if ( overrideReturn != null )
                 {
@@ -539,68 +534,15 @@
         return new NotLoggedInException( actionName, this );
     }
     
-    /**
-     * Get the Struts module path for this controller.
-     * 
-     * @return a String that is the Struts module path for this controller - 
the parent directory
-     * for a [EMAIL PROTECTED] PageFlowController} and "/-global" for 
Global.app.
-     */ 
-    public abstract String getModulePath();
-
-    /**
-     * Callback that occurs before any user action method is invoked.  [EMAIL 
PROTECTED] #getRequest},
-     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession}, and 
[EMAIL PROTECTED] #getMapping} may all be used
-     * during this method.  The action to be run can be discovered by calling
-     * [EMAIL PROTECTED] ActionMapping#getPath} on the value returned from 
[EMAIL PROTECTED] #getMapping}.
-     */ 
-    protected synchronized void beforeAction()
-        throws Exception
-    {
-    }
-    
-    /**
-     * Callback that occurs after any user action method is invoked.  [EMAIL 
PROTECTED] #getRequest},
-     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession}, and 
[EMAIL PROTECTED] #getMapping} may all be used
-     * during this method.  The action that was run can be discovered by 
calling
-     * [EMAIL PROTECTED] ActionMapping#getPath} on the value returned from 
[EMAIL PROTECTED] #getMapping}.
-     */ 
-    protected synchronized void afterAction()
-        throws Exception
-    {
-    }
-    
-    /**
-     * Initialize transient data that may have been lost during session 
failover.
-     * @exclude public for Portal
-     */ 
-    public void reinitialize( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
-    {
-        _servletContext = servletContext;
-        
-        //
-        // Cache the associated ModuleConfig.  This is used throughout the 
code, in places where the request
-        // isn't available to do a lazy initialization.
-        //
-        initModuleConfig( servletContext, request );
-    }
-    
-    synchronized void create( HttpServletRequest request, HttpServletResponse 
response,
-                                    ServletContext servletContext )
+    synchronized void create( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
     {
-        reinitialize( request, response, servletContext );
-        
-        //
-        // Initialize Java Controls in this FlowController.
-        //
-        initJavaControls( request, response );
-        
         PerRequestState prevState = setPerRequestState( new PerRequestState( 
request, response, null ) );
-
+        
         try
         {
             try
             {
-                onCreate();
+                super.create( request, response, servletContext );
             }
             catch ( Throwable th )
             {
@@ -622,26 +564,55 @@
         }
     }
     
+    void destroy( HttpSession session )
+    {
+        onDestroy();    // for backwards compatiblity
+        super.destroy( session );
+    }
+    
     /**
-     * Callback that is invoked when this controller instance is created.  
[EMAIL PROTECTED] #getRequest},
-     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession} may all 
be used during this method.
+     * Get the Struts module path for this controller.
+     * 
+     * @return a String that is the Struts module path for this controller - 
the parent directory
+     * for a [EMAIL PROTECTED] PageFlowController} and "/-global" for 
Global.app.
      */ 
-    protected void onCreate()
+    public abstract String getModulePath();
+
+    /**
+     * Callback that occurs before any user action method is invoked.  [EMAIL 
PROTECTED] #getRequest},
+     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession}, and 
[EMAIL PROTECTED] #getActionMapping} may all be used
+     * during this method.  The action to be run can be discovered by calling
+     * [EMAIL PROTECTED] ActionMapping#getPath} on the value returned from 
[EMAIL PROTECTED] #getActionMapping}.
+     */ 
+    protected synchronized void beforeAction()
         throws Exception
     {
     }
     
-    void destroy( HttpSession session )
+    /**
+     * Callback that occurs after any user action method is invoked.  [EMAIL 
PROTECTED] #getRequest},
+     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession}, and 
[EMAIL PROTECTED] #getActionMapping} may all be used
+     * during this method.  The action that was run can be discovered by 
calling
+     * [EMAIL PROTECTED] ActionMapping#getPath} on the value returned from 
[EMAIL PROTECTED] #getActionMapping}.
+     */ 
+    protected synchronized void afterAction()
+        throws Exception
     {
-        onDestroy();    // for backwards compatiblity
-        onDestroy( session );
-        uninitJavaControls();
     }
 
-    
+    /**
+     * Callback that is invoked when this controller instance is created.  
[EMAIL PROTECTED] #getRequest},
+     * [EMAIL PROTECTED] #getResponse}, [EMAIL PROTECTED] #getSession} may all 
be used during this method.
+     */ 
+    protected void onCreate()
+        throws Exception
+    {
+    }
+
+
     /**
      * Callback that is invoked when this controller instance is "destroyed", 
i.e., removed from the
-     * user session.  [EMAIL PROTECTED] #getRequest}, [EMAIL PROTECTED] 
#getResponse}, and [EMAIL PROTECTED] #getMapping} may <i>not</i>
+     * user session.  [EMAIL PROTECTED] #getRequest}, [EMAIL PROTECTED] 
#getResponse}, and [EMAIL PROTECTED] #getActionMapping} may <i>not</i>
      * be used during this method, since it may be called due to session 
termination outside of a
      * request.  [EMAIL PROTECTED] #getSession} also may not be used, but the 
session is passed as an argument
      * to [EMAIL PROTECTED] #onDestroy(javax.servlet.http.HttpSession)}, which 
should be used in place of this
@@ -659,7 +630,7 @@
     
     /**
      * Callback that is invoked when this controller instance is "destroyed", 
i.e., removed from the
-     * user session.  [EMAIL PROTECTED] #getRequest}, [EMAIL PROTECTED] 
#getResponse}, and [EMAIL PROTECTED] #getMapping} may <i>not</i>
+     * user session.  [EMAIL PROTECTED] #getRequest}, [EMAIL PROTECTED] 
#getResponse}, and [EMAIL PROTECTED] #getActionMapping} may <i>not</i>
      * be used during this method, since it may be called due to session 
termination outside of a
      * request.  [EMAIL PROTECTED] #getSession} also may not be used, but the 
session is passed as an argument.
      * <br>
@@ -747,7 +718,7 @@
             
             if ( formClassName != null )
             {
-                return InternalUtils.getReloadableClass( formClassName, 
request, getServlet().getServletContext() );
+                return InternalUtils.getReloadableClass( formClassName, 
request, getServletContext() );
             }
         }
         
@@ -1178,22 +1149,6 @@
     }
     
     /**
-     * Stores this controller in the user session, in the appropriate place.
-     */ 
-    abstract void persistInSession( HttpServletRequest request, 
HttpServletResponse response,
-                                    ServletContext 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.  Note that this method 
is used by the framework
-     * and does not need to be called explicitly in most cases.
-     * 
-     * @param request the current HttpServletRequest
-     */ 
-    public abstract void ensureFailover( HttpServletRequest request ); 
-    
-    /**
      * Get the current Struts ActionServlet.
      * 
      * @deprecated This method will be removed with no replacement.  In most 
cases, [EMAIL PROTECTED] #getServletContext()} is
@@ -1203,7 +1158,7 @@
      */ 
     protected ActionServlet getServlet()
     {
-        return InternalUtils.getActionServlet( _servletContext );
+        return InternalUtils.getActionServlet( getServletContext() );
     }
     
     /**
@@ -1251,23 +1206,7 @@
                                boolean isSpecialForward )
     {
     }
-    
-    /**
-     * Callback when this FlowController is added to the user session.
-     */ 
-    public void valueBound( HttpSessionBindingEvent event )
-    {
-    }
-    
-    /**
-     * Callback when this FlowController is removed from the user session.  
Causes [EMAIL PROTECTED] #onDestroy}
-     * to be called.
-     */ 
-    public void valueUnbound( HttpSessionBindingEvent event )
-    {
-        destroy( event.getSession() );
-    }    
-    
+
     /**
      * Tell whether this is a "singleton" page flow.  Once it is invoked, a 
singleton page flow is never
      * removed from the session unless [EMAIL PROTECTED] #delete} is called.  
Navigating to another page flow hides
@@ -1340,13 +1279,6 @@
     }
 
     /**
-     * Remove this instance from the session.  The base implementation does 
not do anything.
-     */ 
-    protected void delete()
-    {
-    }
-
-    /**
      * Increment the count of concurrent requests to this page flow.  Note 
that this method
      * is not synchronized -- we use it to decide whether to synchronize on 
this instance,
      * or to bail out with an error message about too many concurrent requests.
@@ -1413,109 +1345,7 @@
         assert _requestCount > 0 : request.getRequestURI();
         --_requestCount;
     }
-    
-    /**
-     * Initialize all null member variables that are Java Controls.
-     * 
-     * @param request the current HttpServletRequest.
-     */ 
-    private void initJavaControls( HttpServletRequest request, 
HttpServletResponse response )
-    {
-        //
-        // First, unwrap the request if it's a MultipartRequestWrapper.  
MultipartRequestWrapper is a Struts
-        // class that does *not* extend HttpServletRequestWrapper, and which 
thus causes KNEX pain when it
-        // tries to unwrap it.
-        //
-        if ( request instanceof MultipartRequestWrapper )
-        {
-            request = ( ( MultipartRequestWrapper ) request ).getRequest();
-        }
-        
-        Map controlFields = 
JavaControlUtils.getAccessibleControlFieldAnnotations( getClass() );
 
-        if ( controlFields.isEmpty() )
-        {
-            return;
-        }
-
-        String className = getClass().getName();
-        ControlBeanContext beanContext = 
JavaControlUtils.getControlBeanContext( request, response, false );
-        assert beanContext != null : "ControlBeanContext was not initialized 
by PageFlowRequestProcessor";
-        
-        for ( Iterator i = controlFields.entrySet().iterator(); i.hasNext(); )
-        {
-            Map.Entry entry = ( Map.Entry ) i.next();
-            Field field = ( Field ) entry.getKey();
-
-            //
-            // We don't want the field to be transient -- the proxy should not 
go away when this
-            // object is serialized/deserialized.  The checker should enforce 
this.
-            //
-            assert ! Modifier.isTransient( field.getModifiers() ) : 
field.getName();
-            
-            try
-            {
-                if ( field.get( this ) == null )      // make sure it's not 
already initialized
-                {
-                    if ( _log.isTraceEnabled() )
-                    {
-                        _log.trace( "Initializing field " + field.getName() + 
" (" + field.getType().getName()
-                                    + ") with a Java Control..." );
-                    }
-                    
-                    PropertyMap propertyMap = ( PropertyMap ) entry.getValue();
-                    Class fieldType = field.getType();
-                    boolean isControlBeanClass = ! fieldType.isInterface();
-                    String controlID = className + '.' + field.getName();
-                    ControlBean bean = JavaControlUtils.createControl( 
fieldType.getName(), isControlBeanClass,
-                                                                       
controlID, propertyMap, beanContext );
-                    field.set( this, bean );
-                }
-            }
-            catch ( JavaControlUtils.ControlInstantiationException e )
-            {
-                _log.error( "Exception while initializing Java Control " + 
field.getName(), e );
-            }
-            catch ( IllegalAccessException e )
-            {
-                _log.error( "Exception while initializing Java Control " + 
field.getName(), e );
-            }
-        }
-    }    
-    
-    /**
-     * Clean up all member variables that are Java Controls.
-     */ 
-    private void uninitJavaControls()
-    {
-        Map controlFields = 
JavaControlUtils.getAccessibleControlFieldAnnotations( getClass() );
-        
-        for ( Iterator i = controlFields.keySet().iterator(); i.hasNext(); )
-        {
-            Field controlField = ( Field ) i.next();
-
-            try
-            {
-                Object fieldValue = controlField.get( this );
-                
-                if ( fieldValue != null )
-                {
-                    controlField.set( this, null );
-                    JavaControlUtils.destroyControl( fieldValue );
-                }
-            }
-            catch ( IllegalAccessException e )
-            {
-                _log.error( "Exception while uninitializing Java Control " + 
controlField.getName(), e );
-            }            
-        }
-    }
-    
-    protected ServletContext getServletContext()
-    {
-        return _servletContext;
-    }
-    
     /**
      * Invoke the given exception handler method.
      * @exclude
@@ -1658,6 +1488,5 @@
         
         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/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 20 07:26:34 2004
@@ -253,7 +253,9 @@
         if ( curJpf != null )
         {
             curJpf.setImplicitObject( request );
-            InternalUtils.setFacesBackingBean( request, _servletContext );
+            FacesBackingBean fbb =
+                    FacesBackingBeanFactory.getFacesBackingBeanForRequest( 
request, response, _servletContext );
+            if ( fbb != null ) fbb.setImplicitObject( request );
             request.setAttribute( "pageInput", 
InternalUtils.getActionOutputMap( request, false ) );
         }
         

Added: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
     Fri Aug 20 07:26:34 2004
@@ -0,0 +1,232 @@
+/*
+ * 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.upload.MultipartRequestWrapper;
+import org.apache.beehive.netui.pageflow.internal.JavaControlUtils;
+import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.properties.PropertyMap;
+import org.apache.beehive.controls.api.bean.ControlBean;
+
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.ServletContext;
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Iterator;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+abstract class PageFlowManagedObject implements Serializable, 
HttpSessionBindingListener
+{
+    private static final Logger _log = Logger.getInstance( 
PageFlowManagedObject.class );
+    
+    
+    /**
+     * Reference to the current ServletContext.
+     */ 
+    private transient ServletContext _servletContext;
+
+    /**
+     * Initialize transient data that may have been lost during session 
failover.
+     * @exclude public for Portal
+     */ 
+    public void reinitialize( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
+    {
+        _servletContext = servletContext;
+    }
+
+    synchronized void create( HttpServletRequest request, HttpServletResponse 
response, ServletContext servletContext )
+        throws Exception
+    {
+        reinitialize( request, response, servletContext );
+        initJavaControls( request, response );
+        onCreate();
+    }
+
+    void destroy( HttpSession session )
+    {
+        onDestroy( session );
+        uninitJavaControls();
+    }
+    
+    /**
+     * Create-time callback.  Occurs after internal initialization (e.g., Java 
Controls) is done.
+     * @throws Exception
+     */ 
+    protected void onCreate()
+        throws Exception
+    {
+    }
+    
+    /**
+     * Callback that occurs when this object is "destroyed", i.e., removed 
from the session.
+     * @param session
+     */ 
+    protected void onDestroy( HttpSession session )
+    {
+    } 
+    
+    /**
+     * Callback when this object is added to the user session.
+     */ 
+    public void valueBound( HttpSessionBindingEvent event )
+    {
+    }
+
+    /**
+     * Callback when this object is removed from the user session.  Causes 
[EMAIL PROTECTED] #onDestroy}
+     * to be called.
+     */ 
+    public void valueUnbound( HttpSessionBindingEvent event )
+    {
+        destroy( event.getSession() );
+    }
+
+    /**
+     * Remove this instance from the session.  The base implementation does 
not do anything.
+     */ 
+    protected void delete()
+    {
+    }
+    
+    /**
+     * Stores this object in the user session, in the appropriate place.
+     */ 
+    abstract void persistInSession( HttpServletRequest request, 
HttpServletResponse response,
+                                    ServletContext servletContext );
+    
+    /**
+     * Ensures that any changes to this object 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.  Note that this method 
is used by the framework
+     * and does not need to be called explicitly in most cases.
+     * 
+     * @param request the current HttpServletRequest
+     */ 
+    public abstract void ensureFailover( HttpServletRequest request ); 
+    
+    /**
+     * Initialize all null member variables that are Java Controls.
+     * 
+     * @param request the current HttpServletRequest.
+     */ 
+    private void initJavaControls( HttpServletRequest request, 
HttpServletResponse response )
+    {
+        //
+        // First, unwrap the request if it's a MultipartRequestWrapper.  
MultipartRequestWrapper is a Struts
+        // class that does *not* extend HttpServletRequestWrapper, and which 
thus causes KNEX pain when it
+        // tries to unwrap it.
+        //
+        if ( request instanceof MultipartRequestWrapper )
+        {
+            request = ( ( MultipartRequestWrapper ) request ).getRequest();
+        }
+        
+        Map controlFields = 
JavaControlUtils.getAccessibleControlFieldAnnotations( getClass() );
+
+        if ( controlFields.isEmpty() )
+        {
+            return;
+        }
+
+        String className = getClass().getName();
+        ControlBeanContext beanContext = 
JavaControlUtils.getControlBeanContext( request, response, false );
+        assert beanContext != null : "ControlBeanContext was not initialized 
by PageFlowRequestProcessor";
+        
+        for ( Iterator i = controlFields.entrySet().iterator(); i.hasNext(); )
+        {
+            Map.Entry entry = ( Map.Entry ) i.next();
+            Field field = ( Field ) entry.getKey();
+
+            //
+            // We don't want the field to be transient -- the proxy should not 
go away when this
+            // object is serialized/deserialized.  The checker should enforce 
this.
+            //
+            assert ! Modifier.isTransient( field.getModifiers() ) : 
field.getName();
+            
+            try
+            {
+                if ( field.get( this ) == null )      // make sure it's not 
already initialized
+                {
+                    if ( _log.isTraceEnabled() )
+                    {
+                        _log.trace( "Initializing field " + field.getName() + 
" (" + field.getType().getName()
+                                    + ") with a Java Control..." );
+                    }
+                    
+                    PropertyMap propertyMap = ( PropertyMap ) entry.getValue();
+                    Class fieldType = field.getType();
+                    boolean isControlBeanClass = ! fieldType.isInterface();
+                    String controlID = className + '.' + field.getName();
+                    ControlBean bean = JavaControlUtils.createControl( 
fieldType.getName(), isControlBeanClass,
+                                                                       
controlID, propertyMap, beanContext );
+                    field.set( this, bean );
+                }
+            }
+            catch ( JavaControlUtils.ControlInstantiationException e )
+            {
+                _log.error( "Exception while initializing Java Control " + 
field.getName(), e );
+            }
+            catch ( IllegalAccessException e )
+            {
+                _log.error( "Exception while initializing Java Control " + 
field.getName(), e );
+            }
+        }
+    }
+
+    /**
+     * Clean up all member variables that are Java Controls.
+     */ 
+    private void uninitJavaControls()
+    {
+        Map controlFields = 
JavaControlUtils.getAccessibleControlFieldAnnotations( getClass() );
+        
+        for ( Iterator i = controlFields.keySet().iterator(); i.hasNext(); )
+        {
+            Field controlField = ( Field ) i.next();
+
+            try
+            {
+                Object fieldValue = controlField.get( this );
+                
+                if ( fieldValue != null )
+                {
+                    controlField.set( this, null );
+                    JavaControlUtils.destroyControl( fieldValue );
+                }
+            }
+            catch ( IllegalAccessException e )
+            {
+                _log.error( "Exception while uninitializing Java Control " + 
controlField.getName(), e );
+            }            
+        }
+    }
+
+    protected ServletContext getServletContext()
+    {
+        return _servletContext;
+    }
+
+    abstract void setImplicitObject( HttpServletRequest request );
+}

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 20 07:26:34 2004
@@ -985,6 +985,10 @@
                             + request.getRequestURI() + ".  Trying this action 
on the SharedFlowController." );
             }
             
+            //
+            // Save the original request URI, so if the action fails on the 
shared flow, too, then we can
+            // give an error message that includes *this* URI, not the shared 
flow URI.
+            //
             RequestVariables.get( request ).setOriginalRequestURI( 
InternalUtils.decodeURI( request ) );
             
             //

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 20 07:26:34 2004
@@ -18,16 +18,8 @@
  */
 package org.apache.beehive.netui.pageflow.internal;
 
-import org.apache.beehive.netui.pageflow.PageFlowUtils;
-import org.apache.beehive.netui.pageflow.PageFlowController;
-import org.apache.beehive.netui.pageflow.FlowControllerFactory;
-import org.apache.beehive.netui.pageflow.PageFlowConstants;
-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.annotations.Jpf;
-import org.apache.beehive.netui.pageflow.SharedFlowController;
-import org.apache.beehive.netui.pageflow.FlowController;
+import org.apache.beehive.netui.pageflow.*;
 import org.apache.beehive.netui.pageflow.handler.ReloadableClassHandler;
 import org.apache.beehive.netui.pageflow.config.PageFlowControllerConfig;
 import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
@@ -991,59 +983,10 @@
         return cc instanceof PageFlowControllerConfig && ( ( 
PageFlowControllerConfig ) cc ).isSharedFlow();
     }
     
-    public static void setFacesBackingBean( HttpServletRequest request, 
ServletContext servletContext )
-    {
-        String relativeURI = PageFlowUtils.getRelativeURI( request, 
InternalUtils.decodeURI( request ), null );
-        assert relativeURI.startsWith( "/" ) : relativeURI;
-        String backingClassName = FileUtils.stripFileExtension( 
relativeURI.substring( 1 ).replace( '/', '.' ) );
-        Object currentBean = getFacesBackingBean( request );
-        
-        if ( currentBean == null || ! currentBean.getClass().getName().equals( 
backingClassName ) )
-        {
-            try
-            {
-                Class backingClass =
-                    ContextCache.get( servletContext 
).getReloadableClassHandler().loadClass( backingClassName, request );
-                
-                if ( backingClass.getAnnotation( Jpf.FacesBacking.class ) != 
null )
-                {
-                    request.getSession().setAttribute( FACES_BACKING_ATTR, 
backingClass.newInstance() );
-                    return;
-                }
-                else
-                {
-                    if ( _log.isDebugEnabled() )
-                    {
-                        _log.debug( "Found matching backing class " + 
backingClassName + "for request " 
-                                    + request.getRequestURI() + ", but it does 
not have the "
-                                    + Jpf.FacesBacking.class.getName() + " 
annotation." );
-                    }
-                }
-            }
-            catch ( ClassNotFoundException e )
-            {
-                if ( _log.isTraceEnabled() )
-                {
-                    _log.trace( "No backing bean class " + backingClassName + 
" found for request "
-                                + request.getRequestURI() );
-                }
-            }
-            catch ( InstantiationException e )
-            {
-                _log.error( "Could not create backing bean instance of " + 
backingClassName, e );
-            }
-            catch ( IllegalAccessException e )
-            {
-                _log.error( "Could not create backing bean instance of " + 
backingClassName, e );
-            }
-            
-            request.getSession().removeAttribute( FACES_BACKING_ATTR );
-        }
-    }
-    
-    public static Object getFacesBackingBean( HttpServletRequest request )
+
+    public static FacesBackingBean getFacesBackingBean( HttpServletRequest 
request )
     {
         HttpSession session = request.getSession( false );
-        return session != null ? session.getAttribute( FACES_BACKING_ATTR ) : 
null;
+        return session != null ? ( FacesBackingBean ) session.getAttribute( 
FACES_BACKING_ATTR ) : null;
     }
 }

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/BackingControlsController.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/BackingControlsController.jpf
 Fri Aug 20 07:26:34 2004
@@ -0,0 +1,13 @@
+package backingControls;
+
+import org.apache.beehive.netui.pageflow.*;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+    simpleActions={
+        @Jpf.SimpleAction( name="begin", path="page1.faces" )
+    }
+)
+public class BackingControlsController extends PageFlowController
+{
+}

Copied: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControl.java
 (from rev 36577, 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControl.java)
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControl.java
      (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControl.java
      Fri Aug 20 07:26:34 2004
@@ -16,7 +16,7 @@
  *
  * $Header:$
  */
-package pageFlowCore.lifecycle; 
+package backingControls;
 
 
 @org.apache.beehive.controls.api.bean.ControlInterface()

Copied: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControlImpl.jcs
 (from rev 36577, 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControlImpl.jcs)
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControlImpl.jcs
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/TestControlImpl.jcs
   Fri Aug 20 07:26:34 2004
@@ -1,11 +1,5 @@
-package pageFlowCore.lifecycle; 
+package backingControls;
 
-
-
-/**
- * @jcs:jc-jar label="TestControl"
- * @editor-info:code-gen control-interface="true"
- */
 @org.apache.beehive.controls.api.bean.ControlImplementation()
 public class TestControlImpl implements TestControl
 { 

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsfb
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsfb
    Fri Aug 20 07:26:34 2004
@@ -0,0 +1,31 @@
+package backingControls;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.FacesBackingBean;
+
+
[EMAIL PROTECTED]
+public class page1
+    extends FacesBackingBean
+{
+    @org.apache.beehive.controls.api.bean.Control()
+    private TestControl ctrl;
+
+    private String _message = "";
+
+    public void setMessage( String message )
+    {
+        _message = message;
+    }
+
+    public String getMessage()
+    {
+        return _message;
+    }
+
+    public String doit()
+    {
+        _message = ctrl.sayHello();
+        return null;
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/backingControls/page1.jsp 
    Fri Aug 20 07:26:34 2004
@@ -0,0 +1,15 @@
+<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
+
+<html>
+    <head> <title>Page Flow / JSF / Controls in Backing Classes</title> </head>
+    <body bgcolor="white">
+    <h3>Page Flow / JSF / Controls in Backing Classes</h3>
+    <f:view>
+        <h:form>
+            Message from control: <b><h:outputText 
value="#{backing.message}"/></b>
+            <br>
+            <h:commandLink id="doit" action="#{backing.doit}" value="hit a 
control" />
+        </h:form>
+    </f:view>
+</HTML>  

Modified: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/jpfFaces/page1.jsfb
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/jpfFaces/page1.jsfb   
(original)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/jpfFaces/page1.jsfb   
Fri Aug 20 07:26:34 2004
@@ -1,10 +1,12 @@
 package jpfFaces;
 
 import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.FacesBackingBean;
 
 
 @Jpf.FacesBacking
 public class page1
+    extends FacesBackingBean
 {
     public JpfFacesController.BarForm bar = new JpfFacesController.BarForm();
     private String _foo;

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/NavigateToController.jpf
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/NavigateToController.jpf
   Fri Aug 20 07:26:34 2004
@@ -0,0 +1,16 @@
+package navigateTo;
+
+import org.apache.beehive.netui.pageflow.*;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+    simpleActions={
+        @Jpf.SimpleAction( name="begin", path="page1.faces" ),
+        @Jpf.SimpleAction( name="go1", path="page1.faces" ),
+        @Jpf.SimpleAction( name="go2", path="page2.faces" ),
+        @Jpf.SimpleAction( name="goPrev", 
navigateTo=Jpf.NavigateTo.previousPage )
+    }
+)
+public class NavigateToController extends PageFlowController
+{
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsfb
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsfb 
Fri Aug 20 07:26:34 2004
@@ -0,0 +1,22 @@
+package navigateTo;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.FacesBackingBean;
+
+
[EMAIL PROTECTED]
+public class page1
+    extends FacesBackingBean
+{
+    private String _message = "";
+
+    public void setMessage( String message )
+    {
+        _message = message;
+    }
+
+    public String getMessage()
+    {
+        return _message;
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page1.jsp  
Fri Aug 20 07:26:34 2004
@@ -0,0 +1,18 @@
+<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
+
+<html>
+    <head> <title>Page Flow / JSF / NavigateTo</title> </head>
+    <body bgcolor="white">
+    <h3>Page Flow / JSF / NavigateTo: page 1</h3>
+    <f:view>
+        <h:form>
+            Text in backing file: <b><h:inputText 
value="#{backing.message}"/></b>
+            <br/>
+            Text in view state: <b><h:inputText/></b>
+            <h:commandButton id="stayHere" value="submit" />
+            <br>
+            <h:commandLink id="go2" action="go2" value="go to page 2" />
+        </h:form>
+    </f:view>
+</HTML>  

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsfb
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsfb 
Fri Aug 20 07:26:34 2004
@@ -0,0 +1,11 @@
+package navigateTo;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.FacesBackingBean;
+
+
[EMAIL PROTECTED]
+public class page2
+    extends FacesBackingBean
+{
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsp
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/navigateTo/page2.jsp  
Fri Aug 20 07:26:34 2004
@@ -0,0 +1,15 @@
+<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
+
+<html>
+    <head> <title>Page Flow / JSF / NavigateTo</title> </head>
+    <body bgcolor="white">
+    <h3>Page Flow / JSF / NavigateTo: page 2</h3>
+    <f:view>
+        <h:form>
+            <h:commandLink id="go1" action="go1" value="go to page 1" /> 
(won't restore its backing bean)
+            <br/>
+            <h:commandLink id="goPrev" action="goPrev" value="go to previous 
page" /> (will restore its backing bean)
+        </h:form>
+    </f:view>
+</HTML>  

Modified: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/startRecord.jsp
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/startRecord.jsp
  (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/startRecord.jsp
  Fri Aug 20 07:26:34 2004
@@ -31,8 +31,7 @@
 
   <tr>
     <td align="right"><strong>Test Name: </strong></td>
-    <td align="left"><input name="testName" type="text" size="30" />
-    <i style="color: blue" >or choose from the list of existing tests 
below.</i></td>
+    <td align="left"><input name="testName" type="text" size="30" /></td>
   </tr>
 
   <tr>

Modified: 
incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/test.jsp
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/test.jsp 
(original)
+++ incubator/beehive/trunk/netui/test/webapps/jsf/jsfWeb/testRecorder/test.jsp 
Fri Aug 20 07:26:34 2004
@@ -125,6 +125,32 @@
 <br>
 
 <a href="<%= contextPath 
%>/testRecorder?mode=playback&cmd=stop&testRecorder.filter.skip=true">playback 
STOP, no testId</a>
+<br>
+
+<a href="<%= contextPath 
%>/testRecorder?mode=xml&cmd=xml&file=unknown">unknown XML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=xml&file=config">config 
XML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=xml&file=webapp">webapp 
XML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=xml&file=tests">tests 
XML file</a>
+<br>
+
+<a href="<%= contextPath 
%>/testRecorder?mode=xml&cmd=html&file=unknown">unknown HTML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=html&file=config">config 
HTML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=html&file=webapp">webapp 
HTML file</a>
+<br>
+
+<a href="<%= contextPath %>/testRecorder?mode=xml&cmd=html&file=tests">tests 
HTML file</a>
+<br>
+
 </body>
 
 </html>

Reply via email to