You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2004/12/07 01:11:45 UTC

svn commit: r110053 - in incubator/beehive/trunk/netui: src/pageflow/org/apache/beehive/netui/pageflow src/pageflow/org/apache/beehive/netui/pageflow/handler src/pageflow/org/apache/beehive/netui/pageflow/internal src/scoping/org/apache/beehive/netui/pageflow/scoping/internal src/util/org/apache/beehive/netui/util src/util/schema test/webapps/drt/testRecorder/tests

Author: rich
Date: Mon Dec  6 16:11:44 2004
New Revision: 110053

URL: http://svn.apache.org/viewcvs?view=rev&rev=110053
Log:
- Exception-handling cleanup and refactoring before Shared Flow work.
- Added SessionExpiredException, which is thrown *in place of* other exceptions that allow it, when the ultimate reason is (probably) session expiration.  This is enabled/disabled by the throw-session-expired-exception flag within pageflow-config in netui-config.xml.

DRT/BVT: netui (WinXP)
BB: self (linux)


Removed:
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DeferredPageFlowException.java
Modified:
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.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/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/IllegalActionOutputException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.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/UnfulfilledRolesException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.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/InternalUtils.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java
   incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java
   incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
   incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
   incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
   incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java	Mon Dec  6 16:11:44 2004
@@ -47,4 +47,9 @@
     {
         return _form;
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleFormPostException.java	Mon Dec  6 16:11:44 2004
@@ -17,18 +17,18 @@
  */
 package org.apache.beehive.netui.pageflow;
 
-import org.apache.beehive.netui.pageflow.internal.DeferredPageFlowException;
-
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 public class DoubleFormPostException
-        extends DeferredPageFlowException
+        extends PageFlowException
+        implements ResponseErrorCodeSender
 {
-    public DoubleFormPostException( String actionName )
+    DoubleFormPostException( String actionName, FlowController fc )
     {
-        super( actionName );
+        super( actionName, fc );
     }
-    
+
     protected Object[] getMessageArgs()
     {
         return new Object[]{ getActionName(), getFlowControllerURI() };
@@ -39,8 +39,13 @@
         return new String[]{ "A double-post occurred for action ", " in page flow ", "." };
     }
     
-    public int getResponseErrorCode()
+    public void sendResponseErrorCode( HttpServletResponse response ) throws IOException
+    {
+        response.sendError( HttpServletResponse.SC_BAD_REQUEST, getLocalizedMessage() );
+    }
+    
+    public boolean causeMayBeSessionExpiration()
     {
-        return HttpServletResponse.SC_BAD_REQUEST;
+        return true;
     }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java	Mon Dec  6 16:11:44 2004
@@ -41,4 +41,9 @@
     {
         return new String[]{ "Empty nesting stack for returned action ", " from Page Flow ", "." };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return true;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -23,9 +23,8 @@
 import org.apache.beehive.netui.util.FileUtils;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
 import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
-import org.apache.beehive.netui.pageflow.internal.RequestValues;
-import org.apache.beehive.netui.pageflow.internal.DeferredPageFlowException;
-import org.apache.beehive.netui.pageflow.annotations.Jpf;import org.apache.beehive.netui.pageflow.handler.LoginHandler;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.handler.LoginHandler;
 import org.apache.beehive.netui.pageflow.handler.ExceptionsHandler;
 import org.apache.beehive.netui.util.cache.ClassLevelCache;
 import org.apache.beehive.netui.util.logging.Logger;
@@ -43,6 +42,7 @@
 
 import javax.security.auth.login.LoginException;
 import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import javax.servlet.jsp.el.ELException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -227,18 +227,16 @@
      * 
      * @param ex the Exception to handle.
      * @param mapping the Struts action mapping for current Struts action being processed.
-     * @param actionName the name of the Struts action being processed.
      * @param form the form-bean (if any) associated with the Struts action being processed.  May be null.
      * @param request the current HttpServletRequest.
      * @param response the current HttpServletResponse.
      * @return a Struts ActionForward object that specifies the URI that should be displayed.
-     * @throws Exception if another Exception is thrown during handling of <code>ex</code>.
+     * @throws ServletException if another Exception is thrown during handling of <code>ex</code>.
      */ 
     protected synchronized ActionForward handleException( Throwable ex, ActionMapping mapping,
-                                                          String actionName, ActionForm form,
-                                                          HttpServletRequest request,
+                                                          ActionForm form, HttpServletRequest request,
                                                           HttpServletResponse response )
-        throws Exception
+        throws IOException, ServletException
     {
         PerRequestState prevState = setPerRequestState( new PerRequestState( request, response, mapping ) );
         
@@ -249,7 +247,7 @@
             // First, put the exception into the request (or other applicable context).
             Throwable unwrapped = eh.unwrapException( ex );
             eh.exposeException( unwrapped, mapping, request, response, getServletContext() );
-            return eh.handleException( unwrapped, mapping, actionName, form, this, request, response, getServletContext() );
+            return eh.handleException( unwrapped, mapping, form, this, request, response, getServletContext() );
         }
         finally
         {
@@ -270,7 +268,7 @@
 
     protected String getCurrentActionName()
     {
-        return PageFlowUtils.getActionName( getActionMapping() );
+        return InternalUtils.getActionName( getActionMapping() );
     }
     
     /**
@@ -335,7 +333,6 @@
         // First change the actionPath (path) so that it lines up with our naming convention
         // for action methods.
         //
-        String actionName = PageFlowUtils.getActionName( mapping );
         boolean gotPastBeforeAction = false;
         ServletContext servletContext = getServletContext();
         PerRequestState prevState = setPerRequestState( new PerRequestState( request, response, mapping ) );
@@ -388,24 +385,7 @@
                 }                
             }
             
-            //
-            // Look to see if we need are in a disambiguated action, i.e., one whose name is qualified
-            // by the form.  If so, we need to restore the unqualified action name.
-            //
-            if ( pfActionMapping != null )
-            {
-                String unqualifiedAction = pfActionMapping.getUnqualifiedActionName();
-                
-                if ( unqualifiedAction != null )
-                {
-                    actionName = unqualifiedAction;
-                    
-                    if ( _log.isDebugEnabled() )
-                    {
-                        _log.debug( "Using path /" + unqualifiedAction + " instead of " + pfActionMapping.getPath() );
-                    }
-                }
-            }
+            String actionName = InternalUtils.getActionName( mapping );
             
             //
             // Check whether isLoginRequired=true for this action.
@@ -416,22 +396,7 @@
                  && loginHandler.getUserPrincipal( request ) == null )
             {
                 NotLoggedInException ex = createNotLoggedInException( actionName, request );
-                ex.setFlowController( this );
-                return handleException( ex, mapping, actionName, form, request, response );
-            }
-            
-            //
-            //
-            // ...but if there was a role-checking failure in PageFlowRequestProcessor.processRoles(),
-            // throw an exception here.  Doing it this way allows the user to handle the exception
-            // through declarative exception-handling.
-            //
-            DeferredPageFlowException deferredException = RequestValues.getDeferredException( request, true );
-            
-            if ( deferredException != null )
-            {
-                deferredException.setFlowController( this );
-                return handleException( deferredException, mapping, actionName, form, request, response );
+                return handleException( ex, mapping, form, request, response );
             }
             
             //
@@ -458,7 +423,7 @@
             // should not be handled by handleException() -- it's probably a framework problem and
             // should bubble out to the container.
             //
-            return handleException( e, mapping, actionName, form, request, response );
+            return handleException( e, mapping, form, request, response );
         }
         finally
         {
@@ -477,7 +442,7 @@
                     }
                     catch ( Throwable th )
                     {
-                        overrideReturn = handleException( th, mapping, actionName, form, request, response );
+                        overrideReturn = handleException( th, mapping, form, request, response );
                     }
                 }            
                 
@@ -510,21 +475,16 @@
                                          servletContext, this );
     }
     
-    static NotLoggedInException createNotLoggedInException( String actionName, HttpServletRequest request )
+    NotLoggedInException createNotLoggedInException( String actionName, HttpServletRequest request )
     {
-        String requestedSessionID = request.getRequestedSessionId();
-
-        if ( requestedSessionID != null )
+        if ( InternalUtils.sessionExpired( request ) )
         {
-            HttpSession session = request.getSession( false );
-            
-            if ( session == null || ! requestedSessionID.equals( session.getId() ) )
-            {
-                return new LoginExpiredException( actionName );
-            }
+            return new LoginExpiredException( actionName, this );
+        }
+        else
+        {
+            return new NotLoggedInException( actionName, this );
         }
-        
-        return new NotLoggedInException( actionName );
     }
     
     public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
@@ -544,7 +504,7 @@
                 try
                 {
                     _log.info( "Handling exception in onCreate(), page flow " + this, th );
-                    ActionForward fwd = handleException( th, null, "[onCreate]", null, request, response );
+                    ActionForward fwd = handleException( th, null, null, request, response );
                     if ( fwd == null ) fwd = NULL_ACTION_FORWARD;
                     request.setAttribute( ONCREATE_EXCEPTION_FORWARD, fwd );
                 }
@@ -761,7 +721,9 @@
             _log.warn( msg.toString() );
         }
 
-        throw new NoMatchingActionMethodException( actionName, inputForm, this );
+        PageFlowException ex = new NoMatchingActionMethodException( actionName, inputForm, this );
+        InternalUtils.throwPageFlowException( ex, request );
+        return null;
     }
 
     private static String getFormQualifiedActionPath( Class formClass, String actionPath )
@@ -1066,7 +1028,7 @@
         
         if ( mapping == null )
         {
-            throw new ActionNotFoundException( actionName, this, form );
+            InternalUtils.throwPageFlowException( new ActionNotFoundException( actionName, this, form ), request );
         }
         
         ActionForward fwd = getActionMethodForward( actionName, form, request, response, mapping );
@@ -1351,7 +1313,6 @@
      * 
      * @param method the action handler method to invoke.
      * @param ex the Throwable that is to be handled.
-     * @param actionName the name of the Struts action being processed.
      * @param message the String message that is to be passed to the handler method.
      * @param formBean the form bean that is associated with the action being processed; may be
      *            <code>null</code>.
@@ -1359,12 +1320,10 @@
      * @param response the current HttpServletResponse.
      * @param readonly if <code>true</code>, session failover will not be triggered after invoking the method.
      * @return the ActionForward returned by the exception handler method.
-     * @throws Exception if an Exception was raised in user code.
      */
     public synchronized ActionForward invokeExceptionHandler(
-            Method method, Throwable ex, String actionName, String message, Object formBean, ActionForm wrappedFormBean,
+            Method method, Throwable ex, String message, Object formBean, ActionForm wrappedFormBean,
             ActionMapping actionMapping, HttpServletRequest request, HttpServletResponse response, boolean readonly )
-        throws Exception
     {
         ActionForward result = null;
         PerRequestState prevState = setPerRequestState( new PerRequestState( request, response, actionMapping ) );
@@ -1380,6 +1339,12 @@
             try
             {
                 ActionForward retVal = null;
+                String actionName = InternalUtils.getActionName( actionMapping );
+                
+                if ( actionName == null && ex instanceof PageFlowException )
+                {
+                    actionName = ( ( PageFlowException ) ex ).getActionName();
+                }
             
                 try
                 {

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -292,10 +292,11 @@
         
         if ( _init && getRedirect() )
         {
-            String actionPath = ( _mappingPath != null ? _mappingPath : "" );
-            String descrip = ( getName() != null ? getName() : getPath() );
-            throw new IllegalRedirectOutputFormException( descrip, actionPath, _flowController,
-                                                          formBean.getClass().getName() );
+            String actionPath = _mappingPath != null ? _mappingPath : "";
+            String descrip = getName() != null ? getName() : getPath();
+            PageFlowException ex =  new IllegalRedirectOutputFormException( descrip, actionPath, _flowController,
+                                                                            formBean.getClass().getName() );
+            InternalUtils.throwPageFlowException( ex );
         }
 
         _outputForms.add( InternalUtils.wrapFormBean( formBean ) );
@@ -415,7 +416,8 @@
 
             if ( fwd == null )
             {
-                throw new UnresolvableForwardException( getName(), _mappingPath, _flowController );
+                PageFlowException ex = new UnresolvableForwardException( getName(), _mappingPath, _flowController );
+                InternalUtils.throwPageFlowException( ex );
             }
 
             initFrom( fwd );
@@ -424,14 +426,18 @@
             {
                 if ( _actionOutputs != null && ! _actionOutputs.isEmpty() )
                 {
-                    throw new IllegalActionOutputException( getName(), _mappingPath, _flowController,
-                                                           ( String ) _actionOutputs.keySet().iterator().next() );
+                    PageFlowException ex =
+                            new IllegalActionOutputException( getName(), _mappingPath, _flowController,
+                                                             ( String ) _actionOutputs.keySet().iterator().next() );
+                    InternalUtils.throwPageFlowException( ex );
                 }
                 
                 if ( _outputForms != null && ! _outputForms.isEmpty() )
                 {
-                    throw new IllegalRedirectOutputFormException( getName(), _mappingPath, _flowController,
-                                                                  _outputForms.get( 0 ).getClass().getName() );
+                    PageFlowException ex =
+                            new IllegalRedirectOutputFormException( getName(), _mappingPath, _flowController,
+                                                                    _outputForms.get( 0 ).getClass().getName() );
+                    InternalUtils.throwPageFlowException( ex );
                 }
             }
         }
@@ -558,9 +564,11 @@
                 
                 if ( ! returnFormClass.isInstance( outputForm ) )
                 {
-                    throw new IllegalOutputFormTypeException( getName(), _mappingPath, _flowController,
-                                                              outputForm.getClass().getName(),
-                                                              returnFormClass.getName() );
+                    PageFlowException ex = 
+                            new IllegalOutputFormTypeException( getName(), _mappingPath, _flowController,
+                                                                outputForm.getClass().getName(),
+                                                                returnFormClass.getName() );
+                    InternalUtils.throwPageFlowException( ex );
                 }
             }
             
@@ -587,8 +595,9 @@
             if ( ! actionOutput.getNullable()
                  && ( _actionOutputs == null || _actionOutputs.get( actionOutput.getName() ) == null ) )
             {
-                throw new MissingActionOutputException( _mappingPath, _flowController, actionOutput.getName(),
-                                                        getName() );
+                PageFlowException ex =
+                    new MissingActionOutputException( _mappingPath, _flowController, actionOutput.getName(), getName() );
+                InternalUtils.throwPageFlowException( ex );
             }
                 
             //
@@ -640,10 +649,12 @@
                         
                     if ( actualArrayDims != expectedArrayDims || ! expectedType.isAssignableFrom( actualType ) )
                     {
-                        throw new MismatchedActionOutputException( _mappingPath, _flowController,
-                                                                   actionOutput.getName(), getName(),
-                                                                   expectedTypeName,
-                                                                   actualType.getName() + arraySuffix );
+                        PageFlowException ex =
+                                new MismatchedActionOutputException( _mappingPath, _flowController,
+                                                                     actionOutput.getName(), getName(),
+                                                                     expectedTypeName,
+                                                                     actualType.getName() + arraySuffix );
+                        InternalUtils.throwPageFlowException( ex );
                     }
                 }
             }
@@ -896,7 +907,8 @@
         {
             String actionPath = ( _mappingPath != null ? _mappingPath : "" );
             String descrip = ( getName() != null ? getName() : getPath() );
-            throw new IllegalActionOutputException( descrip, actionPath, _flowController, name );
+            PageFlowException ex = new IllegalActionOutputException( descrip, actionPath, _flowController, name );
+            InternalUtils.throwPageFlowException( ex );
         }
         
         _actionOutputs.put( name, value );

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -69,7 +69,9 @@
 
             if ( ! pageFlowFwd.doesResolve() )
             {
-                throw new UnresolvableForwardException( pageFlowFwd.getName(), actionName, flowController );
+                PageFlowException ex =
+                        new UnresolvableForwardException( pageFlowFwd.getName(), actionName, flowController );
+                InternalUtils.throwPageFlowException( ex, request );
             }
 
             //
@@ -89,7 +91,8 @@
                 
                 if ( curJpf == null )
                 {
-                    throw new NoCurrentPageFlowException( actionName, pageFlowFwd );
+                    PageFlowException ex = new NoCurrentPageFlowException( actionName, pageFlowFwd );
+                    InternalUtils.throwPageFlowException( ex, request );
                 }
                 
                 PreviousPageInfo prevPageInfo;
@@ -196,7 +199,8 @@
                 _log.info( "Attempted return-to-page, but previous page info was missing." );
             }
         
-            throw new NoPreviousPageException( actionName, pageFlowFwd, currentPageFlow );
+            PageFlowException ex = new NoPreviousPageException( actionName, pageFlowFwd, currentPageFlow );
+            InternalUtils.throwPageFlowException( ex, request );
         }
         
         //
@@ -298,7 +302,8 @@
         
         if ( curJpf == null )
         {
-            throw new NoCurrentPageFlowException( actionName, pageFlowFwd );
+            PageFlowException ex = new NoCurrentPageFlowException( actionName, pageFlowFwd );
+            InternalUtils.throwPageFlowException( ex, request );
         }
                         
         PreviousActionInfo prevActionInfo = curJpf.getPreviousActionInfo();
@@ -353,7 +358,10 @@
                 _log.info( "Attempted return-to-action, but previous action info was missing." );
             }
             
-            throw new NoPreviousActionException( actionName, pageFlowFwd, curJpf );
+            PageFlowException ex = new NoPreviousActionException( actionName, pageFlowFwd, curJpf );
+            InternalUtils.throwPageFlowException( ex, request );
+            assert false;   // previous method always throws
+            return null;
         }
     }
     
@@ -361,7 +369,7 @@
                                   HttpServletResponse response, ActionForm form, ServletContext servletContext,
                                   FlowController flowController )
     {
-        return forwardTo( fwd, mapping, request, response, PageFlowUtils.getActionName( mapping ), null, form,
+        return forwardTo( fwd, mapping, request, response, InternalUtils.getActionName( mapping ), null, form,
                           servletContext, flowController );
     }
     
@@ -389,7 +397,8 @@
                 _log.warn( msg.append( '.' ).toString() );
             }
                     
-            throw new EmptyNestingStackException( exitAction, curJpf );
+            PageFlowException ex = new EmptyNestingStackException( exitAction, curJpf );
+            InternalUtils.throwPageFlowException( ex, request );
         }
                 
         PageFlowStack.PushedPageFlow pushedPageFlowWrapper = pfStack.pop( request );

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java	Mon Dec  6 16:11:44 2004
@@ -98,4 +98,9 @@
             "\"), but is set to redirect=\"true\".  Action outputs may not be used on redirect forwards."
         };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java	Mon Dec  6 16:11:44 2004
@@ -82,4 +82,9 @@
     {
         _outputFormType = outputFormType;
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java	Mon Dec  6 16:11:44 2004
@@ -44,4 +44,9 @@
             "."
         };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/LoginExpiredException.java	Mon Dec  6 16:11:44 2004
@@ -25,11 +25,6 @@
 public class LoginExpiredException
         extends NotLoggedInException
 {    
-    public LoginExpiredException( String actionName )
-    {
-        super( actionName );
-    }
-    
     public LoginExpiredException( String actionName, FlowController fc )
     {
         super( actionName, fc );

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java	Mon Dec  6 16:11:44 2004
@@ -69,4 +69,9 @@
     {
         return _actualType;
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java	Mon Dec  6 16:11:44 2004
@@ -55,4 +55,9 @@
     {
         return _forwardName;
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java	Mon Dec  6 16:11:44 2004
@@ -37,4 +37,9 @@
     {
         return new String[]{ "No current page flow for return-to=\"", "\" on action ", "." };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return true;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java	Mon Dec  6 16:11:44 2004
@@ -56,4 +56,9 @@
             "Could not find matching action method for action=", ", form=", " on Page Flow ", "."
         };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java	Mon Dec  6 16:11:44 2004
@@ -17,9 +17,8 @@
  */
 package org.apache.beehive.netui.pageflow;
 
-import org.apache.beehive.netui.pageflow.internal.DeferredPageFlowException;
-
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 
 /**
@@ -34,13 +33,9 @@
  * will be thrown instead of the <code>NotLoggedInException</code>.
  */ 
 public class NotLoggedInException
-        extends DeferredPageFlowException
+        extends PageFlowException
+        implements ResponseErrorCodeSender
 {
-    public NotLoggedInException( String actionName )
-    {
-        super( actionName );
-    }
-    
     public NotLoggedInException( String actionName, FlowController fc )
     {
         super( actionName, fc );
@@ -55,12 +50,17 @@
     {
         return new String[]
         {
-            "Action ", " on Page Flow ", " requires a current user, but there is no logged-in user."
+            "Action ", " on page flow ", " requires a current user, but there is no logged-in user."
         };
     }
 
-    public int getResponseErrorCode()
+    public void sendResponseErrorCode( HttpServletResponse response ) throws IOException
+    {
+        response.sendError( HttpServletResponse.SC_BAD_REQUEST, getLocalizedMessage() );
+    }
+
+    public boolean causeMayBeSessionExpiration()
     {
-        return HttpServletResponse.SC_BAD_REQUEST;
+        return true;
     }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java	Mon Dec  6 16:11:44 2004
@@ -19,6 +19,7 @@
 
 import org.apache.beehive.netui.util.Bundle;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.struts.action.ActionMapping;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -82,4 +83,6 @@
     {
         return _actionName;
     }
+    
+    public abstract boolean causeMayBeSessionExpiration();
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -43,7 +43,6 @@
 import javax.servlet.FilterChain;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
-import javax.servlet.Filter;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import java.io.IOException;
@@ -79,7 +78,6 @@
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
 import org.apache.beehive.netui.pageflow.internal.JavaControlUtils;
 import org.apache.beehive.netui.pageflow.internal.FlowControllerAction;
-import org.apache.beehive.netui.pageflow.internal.DeferredPageFlowException;
 import org.apache.beehive.netui.pageflow.internal.ServerAdapterManager;
 import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
 import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
@@ -141,21 +139,6 @@
             action.setServlet( servlet );
             return action;
         }
-        else
-        {
-            //
-            // It's a non-FlowController action.  Now act on any deferred failure from
-            // processRoles() in the same way that Struts would have acted, namely, by
-            // sending an HTTP error.
-            //
-            DeferredPageFlowException deferredEx = RequestValues.getDeferredException( request, true );
-            
-            if ( deferredEx != null )
-            {
-                response.sendError( deferredEx.getResponseErrorCode(), deferredEx.getResponseErrorMessage() );
-                return null;
-            }
-        }
 
         return super.processActionCreate( request, response, actionMapping );
     }
@@ -249,12 +232,6 @@
                                             ActionMapping mapping )
     {
         //
-        // We're deferring some failures until the action phase.  But if there was a failure, we need to avoid
-        // doing anything here.
-        //
-        if ( RequestValues.getDeferredException( request, false ) != null ) return null;
-        
-        //
         // See if we're using a pageflow-scoped form (a member variable in the current pageflow).
         //
         Field formMemberField = getPageFlowScopedFormMember( mapping, request );
@@ -355,12 +332,6 @@
         throws ServletException
     {
         //
-        // We're deferring some failures until the action phase.  But if there was a failure, we need to avoid
-        // doing anything here.
-        //
-        if ( RequestValues.getDeferredException( request, false ) != null ) return;
-        
-        //
         // If a previous action forwarded us a form, use that -- don't populate it from request parameters.
         //
         ActionForm previousForm = RequestValues.getForwardedForm( request, true );
@@ -405,56 +376,6 @@
         }
     }
 
-    protected boolean processValidate( HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping )
-            throws IOException, ServletException
-    {
-        //
-        // We're deferring some failures until the action phase.  But if there was a failure, we need to avoid
-        // doing anything here.
-        //
-        if ( RequestValues.getDeferredException( request, false ) == null )
-        {
-            return super.processValidate( request, response, form, mapping );
-        }
-        else
-        {
-            return true;
-        }
-    }
-
-    protected boolean processForward( HttpServletRequest request, HttpServletResponse response, ActionMapping mapping )
-            throws IOException, ServletException
-    {
-        //
-        // We're deferring some failures until the action phase.  But if there was a failure, we need to avoid
-        // doing anything here.
-        //
-        if ( RequestValues.getDeferredException( request, false ) == null )
-        {
-            return super.processForward( request, response, mapping );
-        }
-        else
-        {
-            return true;
-        }
-    }
-
-    protected boolean processInclude( HttpServletRequest request, HttpServletResponse response, ActionMapping mapping ) throws IOException, ServletException
-    {
-        //
-        // We're deferring some failures until the action phase.  But if there was a failure, we need to avoid
-        // doing anything here.
-        //
-        if ( RequestValues.getDeferredException( request, false ) == null )
-        {
-            return super.processInclude( request, response, mapping );
-        }
-        else
-        {
-            return true;
-        }
-    }
-
     /**
      * The requested action can be overridden by a request parameter.  In this case, we parse the action from
      * the request parameter and forward to a URI constructed from it.
@@ -607,13 +528,15 @@
                         + " for \"controllerClass\".  Page Flow actions in this module may not be handled correctly." );
         }
         
+        FlowController currentFlowController = null;
+        
         if ( flowControllerClassName != null )
         {
             try
             {
-                FlowController fc =
+                currentFlowController = 
                         InternalUtils.getFlowController( flowControllerClassName, request,  response, servletContext );
-                RequestValues.setCurrentFlowController( request, fc );
+                RequestValues.setCurrentFlowController( request, currentFlowController );
             }
             catch ( ClassNotFoundException e )
             {
@@ -635,9 +558,43 @@
         //
         ImplicitObjectUtil.loadImplicitObjects( request, response, servletContext, jpf );
         
-        super.process( request, response );
+        try
+        {
+            super.process( request, response );
+        }
+        catch ( ServletException servletEx )
+        {
+            // If a ServletException escapes out of any of the processing methods, let the current FlowController handle it.
+            if ( ! handleException( servletEx, currentFlowController, request, response ) ) throw servletEx;
+        }
+        catch ( IOException ioe )
+        {
+            // If an IOException escapes out of any of the processing methods, let the current FlowController handle it.
+            if ( ! handleException( ioe, currentFlowController, request, response ) ) throw ioe;
+        }
+        catch ( Throwable th )
+        {
+            // If a Throwable escapes out of any of the processing methods, let the current FlowController handle it.
+            if ( ! handleException( th, currentFlowController, request, response ) ) throw new ServletException( th );
+        }
     }
-
+    
+    private boolean handleException( Throwable th, FlowController fc, HttpServletRequest request,
+                                     HttpServletResponse response )
+            throws ServletException, IOException
+    {
+        if ( fc != null )
+        {
+            ActionMapping mapping = InternalUtils.getCurrentActionMapping( request );
+            ActionForm form = InternalUtils.getCurrentActionForm( request );
+            ActionForward fwd = fc.handleException( th, mapping, form, request, response );
+            processForwardConfig( request, response, fwd );
+            return true;
+        }
+        
+        return false;
+    }
+    
     /**
      * Process any direct request for a page flow by forwarding to its "begin" action.
      * 
@@ -961,7 +918,9 @@
         return false;
     }
     
-    private static void checkTransaction( HttpServletRequest request, ActionMapping mapping )
+    private ActionMapping checkTransaction( HttpServletRequest request, HttpServletResponse response,
+                                            ActionMapping mapping, String actionPath )
+        throws IOException
     {
         //
         // TODO: We haven't yet hooked up the support for marking an action as preventDoublePost=true.
@@ -970,10 +929,29 @@
         {
             if ( ! TokenProcessor.getInstance().isTokenValid( request, true ) )
             {
-                DoubleFormPostException ex = new DoubleFormPostException( PageFlowUtils.getActionName( mapping ) );
-                RequestValues.setDeferredException( request, ex );
+                FlowController currentFC = RequestValues.getCurrentFlowController( request );
+                String actionName = InternalUtils.getActionName( mapping );
+                DoubleFormPostException ex = new DoubleFormPostException( actionName, currentFC );
+                
+                if ( currentFC != null )
+                {
+                    try
+                    {
+                        ActionForward fwd = currentFC.handleException( ex, mapping, null, request, response );
+                        return new ExceptionHandledActionMapping( actionPath, fwd );
+                    }
+                    catch ( ServletException servletException)
+                    {
+                        _log.error( "Exception occurred while handling " + ex.getClass().getName(), servletException );
+                    }
+                }
+                
+                ex.sendResponseErrorCode( response );
+                return null;
             }
         }
+        
+        return mapping;
     }
    
     public void init( ActionServlet actionServlet, ModuleConfig mc )
@@ -1120,8 +1098,7 @@
                                 + ", form " + forwardedFormClass.getName() );
                 }
                 
-                checkTransaction( request, bestMatch );
-                return bestMatch;
+                return checkTransaction( request, response, bestMatch, path );
             }
         }
         
@@ -1146,8 +1123,7 @@
             if ( ! wrongForm )
             {
                 request.setAttribute( Globals.MAPPING_KEY, mapping );
-                checkTransaction( request, mapping );
-                return mapping;
+                return checkTransaction( request, response, mapping, path );
             }
         }
 
@@ -1161,8 +1137,7 @@
             {
                 mapping = ( ActionMapping ) configs[i];
                 request.setAttribute( Globals.MAPPING_KEY, mapping );
-                checkTransaction( request, mapping );
-                return mapping;
+                return checkTransaction( request, response, mapping, path );
             }
         }
 
@@ -1261,11 +1236,11 @@
             {
                 Exception ex = new ActionNotFoundException( actionPath, fc, returningForm );
                 InternalUtils.setCurrentModule( fc.getModuleConfig(), request );
-                ActionForward result = fc.handleException( ex, null, actionPath, null, request, response );
+                ActionForward result = fc.handleException( ex, null, null, request, response );
                 return new ExceptionHandledActionMapping( actionPath, result );
             }
         }
-        catch ( Exception e )
+        catch ( ServletException e )
         {
             // ignore this -- just let Struts do its thing.
             
@@ -1316,24 +1291,34 @@
         }
                 
         //
-        // Here, Struts sends an HTTP error.  We just store the result in the request, so
-        // logic in FlowController can generate an exception at the right time.
+        // Here, Struts sends an HTTP error.  We try to let the current page flow handle a relevant exception.
         //
         LoginHandler loginHandler = ContextCache.get( getServletContext() ).getLoginHandler();
-        String actionName = PageFlowUtils.getActionName( mapping );
-        DeferredPageFlowException ex;
+        String actionName = InternalUtils.getActionName( mapping );
+        FlowController currentFC = RequestValues.getCurrentFlowController( request );
+        PageFlowException ex;
         
         if ( loginHandler.getUserPrincipal( request ) == null )
         {
-            ex = FlowController.createNotLoggedInException( actionName, request );
+            ex = currentFC.createNotLoggedInException( actionName, request );
         }
         else
         {
-            ex = new UnfulfilledRolesException( mapping.getRoleNames(), mapping.getRoles(), actionName );
+            ex = new UnfulfilledRolesException( mapping.getRoleNames(), mapping.getRoles(), actionName, currentFC );
         }
-                        
-        RequestValues.setDeferredException( request, ex );
-        return true;    // We'll fail later, in processActionCreate.
+        
+        if ( currentFC != null )
+        {
+            ActionForward fwd = currentFC.handleException( ex, mapping, null, request, response );
+            processForwardConfig( request, response, fwd );
+        }
+        else
+        {
+            assert ex instanceof ResponseErrorCodeSender : ex.getClass().getName();
+            ( ( ResponseErrorCodeSender ) ex ).sendResponseErrorCode( response );
+        }
+        
+        return false;
     }
     
     private static String addScopeParams( String url, HttpServletRequest request )
@@ -1742,7 +1727,7 @@
         //
         if ( ! ActionInterceptorChain.isReturningFromIntercept( request ) && pfc != null )
         {
-            String actionName = PageFlowUtils.getActionName( mapping );
+            String actionName = InternalUtils.getActionName( mapping );
             ActionInterceptorChain interceptorChain =
                     ActionInterceptorChain.getBeforeActionChain( actionName, request, servletContext );
             if ( interceptorChain != null )

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -18,6 +18,7 @@
 package org.apache.beehive.netui.pageflow;
 
 import org.apache.beehive.netui.pageflow.config.PageFlowActionFormBean;
+import org.apache.beehive.netui.pageflow.config.PageFlowActionMapping;
 import org.apache.beehive.netui.pageflow.internal.ActionResultImpl;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
 import org.apache.beehive.netui.pageflow.internal.RequestValues;
@@ -914,12 +915,6 @@
         }
         
         return request;
-    }
-    
-    static String getActionName( ActionMapping mapping )
-    {
-        String actionName = mapping.getPath();
-        return ( actionName.charAt( 0 ) == '/' ? actionName.substring( 1 ) : actionName );
     }
     
     /**

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java	Mon Dec  6 16:11:44 2004
@@ -17,10 +17,10 @@
  */
 package org.apache.beehive.netui.pageflow;
 
-import org.apache.beehive.netui.pageflow.internal.DeferredPageFlowException;
 import org.apache.beehive.netui.util.Bundle;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 
 /**
@@ -29,7 +29,8 @@
  * who does not fulfil any of the given roles.
  */ 
 public class UnfulfilledRolesException
-        extends DeferredPageFlowException
+        extends PageFlowException
+        implements ResponseErrorCodeSender
 {
     private String[] _roleNames;
     private String _rolesList;
@@ -40,9 +41,9 @@
      * 
      * @param roleNames an array of String role names.
      */ 
-    public UnfulfilledRolesException( String[] roleNames, String rolesList, String actionName)
+    public UnfulfilledRolesException( String[] roleNames, String rolesList, String actionName, FlowController fc )
      {
-        super( actionName );
+        super( actionName, fc );
         _roleNames = roleNames;
         _rolesList = rolesList;
     }
@@ -71,13 +72,14 @@
         };
     }
 
-    public String getResponseErrorMessage()
+    public void sendResponseErrorCode( HttpServletResponse response ) throws IOException
     {
-        return Bundle.getString( "PageFlow_UnfulfilledRolesException_ResponseMessage", getActionName() );
+        String msg = Bundle.getString( "PageFlow_UnfulfilledRolesException_ResponseMessage", getActionName() );
+        response.sendError( HttpServletResponse.SC_BAD_REQUEST, msg );
     }
 
-    public int getResponseErrorCode()
+    public boolean causeMayBeSessionExpiration()
     {
-        return HttpServletResponse.SC_BAD_REQUEST;
+        return true;
     }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java	Mon Dec  6 16:11:44 2004
@@ -69,4 +69,9 @@
             "Unable to find a forward named \"", "\" on action ", " in Page Flow ", "."
         };
     }
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return false;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ExceptionsHandler.java	Mon Dec  6 16:11:44 2004
@@ -24,9 +24,12 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 
 import org.apache.beehive.netui.pageflow.FlowController;
 
+import java.io.IOException;
+
 
 /**
  * Handler for exception processing.
@@ -34,10 +37,10 @@
 public interface ExceptionsHandler
     extends Handler
 {
-    ActionForward handleException( Throwable ex, ActionMapping actionMapping, String actionName,
-                                   ActionForm form, FlowController flowController, HttpServletRequest request,
+    ActionForward handleException( Throwable ex, ActionMapping actionMapping, ActionForm form,
+                                   FlowController flowController, HttpServletRequest request,
                                    HttpServletResponse response, ServletContext servletContext )
-        throws Exception;
+        throws IOException, ServletException;
 
     Throwable unwrapException( Throwable ex );
 

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -30,6 +30,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.lang.reflect.Method;
@@ -57,10 +58,10 @@
     private static final String CACHEID_EXCEPTION_HANDLER_METHODS = "_netui:exceptionHandlers";
     
     
-    public ActionForward handleException( Throwable ex, ActionMapping actionMapping, String actionName,
-                                          ActionForm form, FlowController flowController , HttpServletRequest request,
-                                          HttpServletResponse response, ServletContext servletContext)
-        throws Exception
+    public ActionForward handleException( Throwable ex, ActionMapping actionMapping, ActionForm form,
+                                          FlowController flowController, HttpServletRequest request,
+                                          HttpServletResponse response, ServletContext servletContext )
+            throws IOException, ServletException
     {
         if ( _log.isInfoEnabled() )
         {
@@ -119,7 +120,7 @@
                 
                 if ( pfExceptionConfig.isHandlerMethod() )
                 {
-                    return invokeExceptionHandlerMethod( ex, pfExceptionConfig, form, actionName, actionMapping,
+                    return invokeExceptionHandlerMethod( ex, pfExceptionConfig, form, actionMapping,
                                                          flowController, request, response, servletContext );
                 }
             }
@@ -154,6 +155,13 @@
             return unwrapException( ( ( UndeclaredThrowableException ) ex ).getUndeclaredThrowable() );
         }
         
+        if ( ex instanceof ServletException )
+        {
+            ServletException servletException = ( ServletException ) ex;
+            Throwable rootCause = servletException.getRootCause();
+            if ( rootCause != null ) return unwrapException( rootCause );
+        }
+        
         return ex;
     }
     
@@ -219,40 +227,58 @@
     protected ActionForward invokeExceptionHandlerClass( Throwable throwable, ExceptionConfig exceptionConfig,
                                                          ActionMapping actionMapping, ActionForm form,
                                                          HttpServletRequest request, HttpServletResponse response )
-        throws Exception
+        throws IOException, ServletException
     {
-        //
-        // Get the exception-handler class and delegate to it.
-        //
         String handlerClassName = exceptionConfig.getHandler();
-        ExceptionHandler handler = ( ExceptionHandler ) RequestUtils.applicationInstance( handlerClassName );
-        Exception ex = throwable instanceof Exception ? ( Exception ) throwable : new Exception( throwable );
-        ActionForward result = handler.execute( ex, exceptionConfig, actionMapping, form, request, response );
+        
+        try
+        {
+            //
+            // Get the exception-handler class and delegate to it.
+            //
+            ExceptionHandler handler = ( ExceptionHandler ) RequestUtils.applicationInstance( handlerClassName );
+            Exception ex = throwable instanceof Exception ? ( Exception ) throwable : new Exception( throwable );
+            ActionForward result = handler.execute( ex, exceptionConfig, actionMapping, form, request, response );
+                    
+            //
+            // See if the path is really relative to the webapp root, not relative to the module.  Struts doesn't by default
+            // support paths that are webapp-relative.
+            //
+            if ( exceptionConfig instanceof PageFlowExceptionConfig
+                    && ( ( PageFlowExceptionConfig ) exceptionConfig ).isPathContextRelative() )
+            {
+                result.setContextRelative( true );
+            }
+                    
+            if ( _log.isDebugEnabled() )
+            {
+                _log.debug( "Exception-handler: forward to " + result.getPath() );
+            }
                 
-        //
-        // See if the path is really relative to the webapp root, not relative to the module.  Struts doesn't by default
-        // support paths that are webapp-relative.
-        //
-        if ( exceptionConfig instanceof PageFlowExceptionConfig
-                && ( ( PageFlowExceptionConfig ) exceptionConfig ).isPathContextRelative() )
+            return result;
+        }
+        catch ( ClassNotFoundException e )
         {
-            result.setContextRelative( true );
+            _log.error( "Could not find exception-handler class " + handlerClassName, e );
+            throw new ServletException( e );
         }
-                
-        if ( _log.isDebugEnabled() )
+        catch ( InstantiationException e )
         {
-            _log.debug( "Exception-handler: forward to " + result.getPath() );
+            _log.error( "Could not create instance of exception-handler class " + handlerClassName, e );
+            throw new ServletException( e );
+        }
+        catch ( IllegalAccessException e )
+        {
+            _log.error( "Could not create instance of exception-handler class " + handlerClassName, e );
+            throw new ServletException( e );
         }
-                
-        return result;
     }
     
     protected ActionForward invokeExceptionHandlerMethod( Throwable ex, PageFlowExceptionConfig exceptionConfig,
-                                                          ActionForm form, String actionName,
-                                                          ActionMapping actionMapping, FlowController flowController,
-                                                          HttpServletRequest request, HttpServletResponse response,
-                                                          ServletContext servletContext )
-        throws Exception
+                                                          ActionForm form, ActionMapping actionMapping,
+                                                          FlowController flowController, HttpServletRequest request,
+                                                          HttpServletResponse response, ServletContext servletContext )
+        throws IOException, ServletException
     {
         String methodName = exceptionConfig.getHandler();
         Object unwrappedFormBean = InternalUtils.unwrapFormBean( form );
@@ -268,7 +294,7 @@
                 message = getMessage( messageKey, null, null, request, servletContext, flowController );
             }
                     
-            return flowController.invokeExceptionHandler( method, ex, actionName, message, unwrappedFormBean,
+            return flowController.invokeExceptionHandler( method, ex, message, unwrappedFormBean,
                                                           form, actionMapping, request, response,
                                                           exceptionConfig.isReadonly() );
         }

Deleted: /incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DeferredPageFlowException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DeferredPageFlowException.java?view=auto&rev=110052
==============================================================================

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java&r2=110053
==============================================================================
--- 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	Mon Dec  6 16:11:44 2004
@@ -21,6 +21,7 @@
 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.config.PageFlowActionMapping;
 import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
 import org.apache.beehive.netui.util.logging.Logger;
 import org.apache.beehive.netui.util.Bundle;
@@ -468,14 +469,6 @@
         errors.add( propertyName, error );
     }
     
-    
-    public static String getActionName( ActionMapping mapping )
-    {
-        String actionName = mapping.getPath();
-        return actionName.charAt( 0 ) == '/' ? actionName.substring( 1 ) : actionName;
-    }
-        
-        
     public static Object newReloadableInstance( String className, HttpServletRequest request, ServletContext servletContext )
         throws ClassNotFoundException, InstantiationException, IllegalAccessException
     {
@@ -1087,5 +1080,77 @@
     public static String addParam( String url, String paramName, String paramVal )
     {
         return url + ( url.indexOf( '?' ) != -1 ? '&' : '?' ) + paramName + '=' + paramVal;
+    }
+    
+    public static String getActionName( ActionMapping mapping )
+    {
+        if ( mapping == null ) return null;
+        
+        String actionName = mapping.getPath();
+        if ( actionName.charAt( 0 ) == '/' ) actionName = actionName.substring( 1 );
+        
+        //
+        // Look to see if we need are in a disambiguated action, i.e., one whose name is qualified
+        // by the form.  If so, we need to restore the unqualified action name.
+        //
+        if ( mapping instanceof PageFlowActionMapping )
+        {
+            String unqualifiedAction = ( ( PageFlowActionMapping ) mapping ).getUnqualifiedActionName();
+            if ( unqualifiedAction != null ) actionName = unqualifiedAction;
+        }
+        
+        return actionName;
+    }
+    
+    public static ActionMapping getCurrentActionMapping( HttpServletRequest request )
+    {
+        return ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
+    }
+    
+    public static ActionForm getCurrentActionForm( HttpServletRequest request )
+    {
+        ActionMapping mapping = getCurrentActionMapping( request );
+        String attribute = mapping != null ? mapping.getAttribute() : null;
+        if ( attribute == null ) return null;
+        
+        if ( "request".equals( mapping.getScope() ) )
+        {
+            return ( ActionForm ) request.getAttribute( attribute );
+        }
+        else
+        {
+            HttpSession session = request.getSession( false );
+            return session != null ? ( ActionForm ) session.getAttribute( attribute ) : null;
+        }
+    }
+    
+    public static boolean sessionExpired( HttpServletRequest request )
+    {
+        String requestedSessionID = request.getRequestedSessionId();
+
+        if ( requestedSessionID != null )
+        {
+            HttpSession session = request.getSession( false );
+            return session == null || ! requestedSessionID.equals( session.getId() );
+        }
+        
+        return false;
+    }
+    
+    public static void throwPageFlowException( PageFlowException ex )
+    {
+        throwPageFlowException( ex, null );
+    }
+    
+    public static void throwPageFlowException( PageFlowException effect, HttpServletRequest request )
+            throws PageFlowException
+    {
+        if ( request != null && effect.causeMayBeSessionExpiration() && sessionExpired( request ) )
+        {
+            PageflowConfig pfc = ConfigUtil.getConfig().getPageflowConfig();
+            if ( pfc != null && pfc.getThrowSessionExpiredException() ) throw new SessionExpiredException( effect );
+        }
+        
+        throw effect;
     }
 }

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/RequestValues.java	Mon Dec  6 16:11:44 2004
@@ -34,7 +34,6 @@
     private static final String AVOID_DIRECT_RESPONSE_OUTPUT_ATTR = ATTR_PREFIX + "_avoidDirectResponseOutput";
     private static final String ORIGINAL_SERVLET_PATH_ATTR = ATTR_PREFIX + "origServletPath";
     private static final String FORWARDED_FORMBEAN_ATTR = ATTR_PREFIX + "forwardedForm";
-    private static final String DEFERRED_EXCEPTION_ATTR = ATTR_PREFIX + "deferredException";
     private static final String CURRENT_FLOWCONTROLLER_ATTR = ATTR_PREFIX + "flowController";
     
     
@@ -104,21 +103,6 @@
         ActionForm form = ( ActionForm ) request.getAttribute( FORWARDED_FORMBEAN_ATTR );
         if ( removeFromRequest ) request.removeAttribute( FORWARDED_FORMBEAN_ATTR );
         return form;
-    }
-    
-    /**
-     * This is an error deferred until FlowController.execute().
-     */ 
-    public static void setDeferredException( ServletRequest request, DeferredPageFlowException e )
-    {
-        request.setAttribute( DEFERRED_EXCEPTION_ATTR, e );
-    }
-    
-    public static DeferredPageFlowException getDeferredException( ServletRequest request, boolean removeFromRequest )
-    {
-        DeferredPageFlowException e = ( DeferredPageFlowException ) request.getAttribute( DEFERRED_EXCEPTION_ATTR );
-        if ( removeFromRequest ) request.removeAttribute( DEFERRED_EXCEPTION_ATTR );
-        return e;
     }
     
     public static void setCurrentFlowController( ServletRequest request, FlowController fc )

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java&r1=110052&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java	(original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java	Mon Dec  6 16:11:44 2004
@@ -43,4 +43,9 @@
     }
 
     protected abstract String[] getMessageParts();
+
+    public boolean causeMayBeSessionExpiration()
+    {
+        return true;
+    }
 }

Modified: incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java&r1=110052&p2=incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java	(original)
+++ incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java	Mon Dec  6 16:11:44 2004
@@ -67,7 +67,6 @@
     static final String ATTR_PREFIX = "_netui:";
     private static final String OUR_SESSION_ATTR = ATTR_PREFIX + "scopedSession";
     private static final String STORED_ATTRS_ATTR = ATTR_PREFIX + "storedAttrs";
-    private static final String HIDDEN_OUTER_REQUEST_ATTRS_ATTR = ATTR_PREFIX + "hiddenAttrs";
 
     private static final Logger logger = Logger.getLogger( ScopedRequestImpl.class );
 

Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties&r1=110052&p2=incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties	(original)
+++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties	Mon Dec  6 16:11:44 2004
@@ -288,6 +288,20 @@
 PageFlow_NotLoggedInException_Message= \
 Action {0} in page flow {1} requires a current user, but there is no logged-in user.
 
+PageFlow_SessionExpiredException_Page= \
+<html><head><title>Page Flow Error - Session Expired</title></head>\n \
+<body>\n \
+<h1>Page Flow Error - Session Expired</h1>\n \
+<table border="1" cellspacing="0">\n \
+<tr><td><b>Page Flow:</b></td><td>{1}</td></tr>\n \
+<tr><td><b>Action:</b></td><td>{0}</td></tr>\n \
+</table><br />\n \
+<span style="color:red">Action <b>{0}</b> cannot be completed because the user session has expired.</span>\n \
+</body></html>\n
+
+PageFlow_SessionExpiredException_Message= \
+Action {0} in page flow {1} cannot be completed because the user session has expired.
+
 PageFlow_ControlFieldInitializationException_Page= \
 <html><head><title>Page Flow Error - Control Field Initialization</title></head>\n \
 <body>\n \

Modified: incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r1=110052&p2=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd	(original)
+++ incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd	Mon Dec  6 16:11:44 2004
@@ -80,6 +80,7 @@
             <xsd:element name="max-forwards-per-request" type="xsd:int" minOccurs="0" maxOccurs="1" default="25"/>
             <xsd:element name="max-nesting-stack-depth" type="xsd:int" minOccurs="0" maxOccurs="1" default="10"/> 
             <xsd:element name="ensure-secure-forwards" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="false"/> 
+            <xsd:element name="throw-session-expired-exception" type="xsd:boolean" minOccurs="0" maxOccurs="1" default="true"/>
             <xsd:element name="multipart-handler" minOccurs="0" maxOccurs="1" default="disabled">
                 <xsd:simpleType>
                     <xsd:restriction base="xsd:string">

Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml?view=diff&rev=110053&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml&r1=110052&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml&r2=110053
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml	(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/MockPortalListenTo.xml	Mon Dec  6 16:11:44 2004
@@ -456,7 +456,7 @@
     <body>
         handled bothHave
         <br>
-        <font color="blue"><span>Note: doing nothing for action /onlyA.</span></font>
+        <font color="blue"><span>Note: doing nothing for action onlyA.</span></font>
         <br>
         <a href="/coreWeb/mockportal/listenTo/ListenToPortal.jsp?b1altAction=begin&b1_submit=true">start over</a>
     </body>