Author: jaz
Date: Sat May 26 12:23:53 2007
New Revision: 541931
URL:
http://svn.apache.org/viewvc?view=rev&rev=541931Log:
fixed a few possible NPE; stopped post-proc from looping
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?view=diff&rev=541931&r1=541930&r2=541931==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sat May 26 12:23:53 2007
@@ -327,22 +327,20 @@
// restore previous redirected request's attribute, so redirected page can display previous request's error msg etc.
String preReqAttStr = (String) request.getSession().getAttribute("_REQ_ATTR_MAP_");
- Map preRequestMap;
if (preReqAttStr != null) {
request.getSession().removeAttribute("_REQ_ATTR_MAP_");
- byte [] reqAttrMapBytes = StringUtil.fromHexString(preReqAttStr);
- preRequestMap = (java.util.Map)org.ofbiz.base.util.UtilObject.getObject(reqAttrMapBytes);
- java.util.Iterator keys= preRequestMap.keySet().iterator();
- while(keys.hasNext()){
- String key = (String) keys.next();
- if("_ERROR_MESSAGE_LIST_".equals(key) ||
- "_ERROR_MESSAGE_MAP_".equals(key) ||
- "_ERROR_MESSAGE_".equals(key) ||
- "_EVENT_MESSAGE_LIST_".equals(key) ||
- "_EVENT_MESSAGE_".equals(key)){
- Object value = preRequestMap.get(key);
- request.setAttribute(key, value);
- }
+ byte[] reqAttrMapBytes = StringUtil.fromHexString(preReqAttStr);
+ Map preRequestMap = (Map) UtilObject.getObject(reqAttrMapBytes);
+ if (preRequestMap != null && preRequestMap.size() > 0) {
+ Iterator keys = preRequestMap.keySet().iterator();
+ while (keys.hasNext()){
+ String key = (String) keys.next();
+ if("_ERROR_MESSAGE_LIST_".equals(key) || "_ERROR_MESSAGE_MAP_".equals(key) || "_ERROR_MESSAGE_".equals(key) ||
+ "_EVENT_MESSAGE_LIST_".equals(key) || "_EVENT_MESSAGE_".equals(key)) {
+ Object value = preRequestMap.get(key);
+ request.setAttribute(key, value);
+ }
+ }
}
}
@@ -384,7 +382,7 @@
} else { // handle views
// first invoke the post-processor events.
Collection postProcEvents = requestManager.getPostProcessor();
- if (postProcEvents != null) {
+ if (chain == null && postProcEvents != null) { // don't run post-proc events on chained requests
Iterator i = postProcEvents.iterator();
while (i.hasNext()) {