You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/02/23 01:54:02 UTC

svn commit: r510736 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java

Author: jaz
Date: Thu Feb 22 16:54:02 2007
New Revision: 510736

URL: http://svn.apache.org/viewvc?view=rev&rev=510736
Log:
default-request now gets included

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

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?view=diff&rev=510736&r1=510735&r2=510736
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Thu Feb 22 16:54:02 2007
@@ -95,6 +95,7 @@
     public static final String INCLUDE = "include";
     public static final String INCLUDE_LOCATION = "location";
 
+    public static final String DEFAULT_REQUEST = "default-request";
     public static final String REQUEST_MAPPING = "request-map";
     public static final String REQUEST_URI = "uri";
     public static final String REQUEST_EDIT = "edit";
@@ -563,11 +564,28 @@
             return null;
         }
 
+        // holder for the default-request
+        String defaultRequest = null;
+
+        List includeElementList = UtilXml.childElementList(root, INCLUDE);
+        Iterator includeElementIter = includeElementList.iterator();
+        while (includeElementIter.hasNext()) {
+            Element includeElement = (Element) includeElementIter.next();
+            String includeLocation = includeElement.getAttribute(INCLUDE_LOCATION);
+            if ((includeLocation != null) && (includeLocation.length() > 0)) {
+                try {
+                    defaultRequest = loadDefaultRequest(null, FlexibleLocation.resolveLocation(includeLocation));
+                } catch (MalformedURLException mue) {
+                    Debug.logError(mue, "Error processing include at [" + includeLocation + "]:" + mue.toString(), module);
+                }
+            }
+        }
+
         Element e = UtilXml.firstChildElement(root, "default-request");
         if (e != null) {
-            return e.getAttribute("request-uri");
+            defaultRequest = e.getAttribute("request-uri");
         }
-        return null;
+        return defaultRequest;
     }
 
     /** Gets a FastMap of handler mappings. */