Author: lektran
Date: Mon Jun 29 12:05:57 2009
New Revision: 789303

URL: http://svn.apache.org/viewvc?rev=789303&view=rev
Log:
Do not save the view if the last view is the same as the current view and 
saveCurrentView is false

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=789303&r1=789302&r2=789303&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 Jun 29 12:05:57 2009
@@ -485,8 +485,12 @@
         // if the request has the save-last-view attribute set, save it now 
before the view can be rendered or other chain done so that the _LAST* session 
attributes will represent the previous request
         if (nextRequestResponse.saveLastView) {
                // Debug.log("======save last view: " + 
session.getAttribute("_LAST_VIEW_NAME_"));
-            session.setAttribute("_SAVED_VIEW_NAME_", 
session.getAttribute("_LAST_VIEW_NAME_"));
-            session.setAttribute("_SAVED_VIEW_PARAMS_", 
session.getAttribute("_LAST_VIEW_PARAMS_"));
+            String lastViewName = (String) 
session.getAttribute("_LAST_VIEW_NAME_");
+            // Do not save the view if the last view is the same as the 
current view and saveCurrentView is false
+            if (!(!nextRequestResponse.saveCurrentView && 
"view".equals(nextRequestResponse.type) && 
nextRequestResponse.value.equals(lastViewName))) {
+                session.setAttribute("_SAVED_VIEW_NAME_", 
session.getAttribute("_LAST_VIEW_NAME_"));
+                session.setAttribute("_SAVED_VIEW_PARAMS_", 
session.getAttribute("_LAST_VIEW_PARAMS_"));
+            }
         }
         String saveName = null;
         if (nextRequestResponse.saveCurrentView) { saveName = "SAVED"; }


Reply via email to