You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2013/05/14 00:30:56 UTC

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

Author: doogie
Date: Mon May 13 22:30:55 2013
New Revision: 1482129

URL: http://svn.apache.org/r1482129
Log:
FEATURE: Allow first-visit and preprocessor events to run "none"; this
is the same as null, and will stop processing.

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=1482129&r1=1482128&r2=1482129&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 Mon May 13 22:30:55 2013
@@ -309,10 +309,10 @@ public class RequestHandler {
                 for (ConfigXMLReader.Event event: controllerConfig.getFirstVisitEventList().values()) {
                     try {
                         String returnString = this.runEvent(request, response, event, null, "firstvisit");
-                        if (returnString != null && !returnString.equalsIgnoreCase("success")) {
-                            throw new EventHandlerException("First-Visit event did not return 'success'.");
-                        } else if (returnString == null) {
+                        if (returnString == null || "none".equalsIgnoreCase(returnString)) {
                             interruptRequest = true;
+                        } else if (!returnString.equalsIgnoreCase("success")) {
+                            throw new EventHandlerException("First-Visit event did not return 'success'.");
                         }
                     } catch (EventHandlerException e) {
                         Debug.logError(e, module);
@@ -324,7 +324,9 @@ public class RequestHandler {
             for (ConfigXMLReader.Event event: controllerConfig.getPreprocessorEventList().values()) {
                 try {
                     String returnString = this.runEvent(request, response, event, null, "preprocessor");
-                    if (returnString != null && !returnString.equalsIgnoreCase("success")) {
+                    if (returnString == null || "none".equalsIgnoreCase(returnString)) {
+                        interruptRequest = true;
+                    } else if (!returnString.equalsIgnoreCase("success")) {
                         if (!returnString.contains(":_protect_:")) {
                             throw new EventHandlerException("Pre-Processor event [" + event.invoke + "] did not return 'success'.");
                         } else { // protect the view normally rendered and redirect to error response view
@@ -347,8 +349,6 @@ public class RequestHandler {
                                 }
                             }
                         }
-                    } else if (returnString == null) {
-                        interruptRequest = true;
                     }
                 } catch (EventHandlerException e) {
                     Debug.logError(e, module);