You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cr...@apache.org on 2006/01/10 21:24:03 UTC

svn commit: r367778 - /beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java

Author: crogers
Date: Tue Jan 10 12:24:01 2006
New Revision: 367778

URL: http://svn.apache.org/viewcvs?rev=367778&view=rev
Log:
Fix for BEEHIVE-1037 - he PageFlowRequestProcessor.processMapping() is not handling a default "unknown" action defined in the GlobalApp.

tests: drt, bvt in netui (WinXP)


Modified:
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=367778&r1=367777&r2=367778&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java Tue Jan 10 12:24:01 2006
@@ -1289,15 +1289,11 @@
         //
         // Look for a mapping for "unknown" paths
         //
-        ActionConfig configs[] = moduleConfig.findActionConfigs();
-        for ( int i = 0; i < configs.length; i++ )
+        ActionMapping unknown = getUnknownActionFromConfig( moduleConfig );
+        if ( unknown != null )
         {
-            if ( configs[i].getUnknown() )
-            {
-                mapping = ( ActionMapping ) configs[i];
-                request.setAttribute( Globals.MAPPING_KEY, mapping );
-                return checkTransaction( request, response, mapping, path );
-            }
+            request.setAttribute( Globals.MAPPING_KEY, unknown );
+            return checkTransaction( request, response, unknown, path );
         }
 
         // If we haven't already tried this action on a shared flow or on Global.app, see if it's in the Global.app
@@ -1306,8 +1302,9 @@
         ModuleConfig globalApp = null;
 
         if (errorServletPath == null
-             && (globalApp = InternalUtils.getModuleConfig(GLOBALAPP_MODULE_CONTEXT_PATH, getServletContext())) != null
-             && globalApp.findActionConfig(path) != null) {
+             && (globalApp = InternalUtils.ensureModuleConfig(GLOBALAPP_MODULE_CONTEXT_PATH, getServletContext())) != null
+             && (globalApp.findActionConfig(path) != null || getUnknownActionFromConfig(globalApp) != null))
+        {
             
             if (_log.isDebugEnabled()) {
                 _log.debug("Trying Global.app for unhandled action " + path);
@@ -1355,6 +1352,19 @@
             if ( errorServletPath != null && path.indexOf( '/' ) > 0 ) path = errorServletPath;
             return processUnresolvedAction( path, request, response, forwardedForm );
         }
+    }
+
+    private ActionMapping getUnknownActionFromConfig( ModuleConfig mc )
+    {
+        ActionConfig configs[] = mc.findActionConfigs();
+        for ( int i = 0; i < configs.length; i++ )
+        {
+            if ( configs[i].getUnknown() )
+            {
+                return ( ActionMapping ) configs[i];
+            }
+        }
+        return null;
     }
 
     protected boolean processSharedFlowMapping( HttpServletRequest request, HttpServletResponse response,