svn commit: r1225746 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1225746 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

hansbak-2
Author: hansbak
Date: Fri Dec 30 03:22:36 2011
New Revision: 1225746

URL: http://svn.apache.org/viewvc?rev=1225746&view=rev
Log:
if an override view is specified in a url and it does not exist, it will not generate a 404 return code but will display an error. this change will do this. example url:  http://localhost:8080/ecommerce/control/main/aaa 

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1225746&r1=1225745&r2=1225746&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Fri Dec 30 03:22:36 2011
@@ -139,6 +139,18 @@ public class RequestHandler {
                 requestMap = requestMapMap.get(defaultRequest);
             }
         }
+        
+        // check for override view
+        if (overrideViewUri != null) {
+            ConfigXMLReader.ViewMap viewMap = getControllerConfig().getViewMapMap().get(overrideViewUri);
+            if (viewMap == null) {
+                String defaultRequest = controllerConfig.getDefaultRequest();
+                if (defaultRequest != null) { // required! to avoid a null pointer exception and generate a requesthandler exception if default request not found.
+                    requestMap = requestMapMap.get(defaultRequest);
+                }
+            }
+        }
+        
         // still not found so stop
         if (requestMap == null) {
             throw new RequestHandlerException(requestMissingErrorMessage);