Can someone please commit these three patches?

TIA,
sean


Index: src/share/org/apache/struts/tiles/TilesRequestProcessor.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/tiles/TilesRequestProcessor.java,v
retrieving revision 1.25
diff -u -r1.25 TilesRequestProcessor.java
--- src/share/org/apache/struts/tiles/TilesRequestProcessor.java        14 Mar 2004 
06:23:43 -0000      1.25
+++ src/share/org/apache/struts/tiles/TilesRequestProcessor.java        22 Sep 2004 
12:57:23 -0000
@@ -173,28 +173,6 @@
                                }
                        }
 
-                       // Process definition set in Action, if any.
-                       definition = DefinitionsUtil.getActionDefinition(request);
-                       if (definition != null) { // We have a definition.
-                               // We use it to complete missing attribute in context.
-                               // We also overload uri and controller if set in 
definition.
-                               if (definition.getPath() != null) {
-                                       uri = definition.getPath();
-                               }
-
-                               if (definition.getOrCreateController() != null) {
-                                       controller = 
definition.getOrCreateController();
-                               }
-
-                               if (tileContext == null) {
-                                       tileContext =
-                                               new 
ComponentContext(definition.getAttributes());
-                                       ComponentContext.setContext(tileContext, 
request);
-                               } else {
-                                       
tileContext.addMissing(definition.getAttributes());
-                               }
-                       }
-
                } catch (java.lang.InstantiationException ex) {
 
                        log.error("Can't create associated controller", ex);
Index: src/share/org/apache/struts/tiles/actions/DefinitionDispatcherAction.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/tiles/actions/DefinitionDispatcherAction.java,v
retrieving revision 1.12
diff -u -r1.12 DefinitionDispatcherAction.java
--- src/share/org/apache/struts/tiles/actions/DefinitionDispatcherAction.java   14 Mar 
2004 06:23:46 -0000      1.12
+++ src/share/org/apache/struts/tiles/actions/DefinitionDispatcherAction.java   22 Sep 
2004 12:56:27 -0000
@@ -32,12 +32,6 @@
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
-import org.apache.struts.tiles.ComponentDefinition;
-import org.apache.struts.tiles.DefinitionsFactoryException;
-import org.apache.struts.tiles.DefinitionsUtil;
-import org.apache.struts.tiles.FactoryNotFoundException;
-import org.apache.struts.tiles.NoSuchDefinitionException;
-import org.apache.struts.tiles.TilesUtil;
 
 /**
  * <p>An <strong>Action</strong> that dispatches to a Tiles Definition
@@ -111,40 +105,8 @@
             return mapping.findForward("error");
         }
 
-        // Try to dispatch to requested definition
-        try {
-            // Read definition from factory, but we can create it here.
-            ComponentDefinition definition =
-                TilesUtil.getDefinition(
-                    name,
-                    request,
-                    getServlet().getServletContext());
-                    
-            if (log.isDebugEnabled()) {
-                log.debug("Get Definition " + definition);
-            }
-            
-            DefinitionsUtil.setActionDefinition(request, definition);
-            
-        } catch (FactoryNotFoundException e) {
-            log.error("Can't get definition factory.", e);
-            return mapping.findForward("error");
-            
-        } catch (NoSuchDefinitionException e) {
-            log.error("Can't get definition '" + name + "'.", e);
-            return mapping.findForward("error");
-            
-        } catch (DefinitionsFactoryException e) {
-            log.error("General Factory error '" + e.getMessage() + "'.", e);
-            return mapping.findForward("error");
-            
-        } catch (Exception e) {
-            log.error("General error '" + e.getMessage() + "'.", e);
-            return mapping.findForward("error");
-        }
-
-        return mapping.findForward("success");
-
+        // TilesRequestProcessor will know what to do from here
+        return new ActionForward(name);
     }
 
     /**
Index: src/share/org/apache/struts/tiles/TilesPlugin.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/tiles/TilesPlugin.java,v
retrieving revision 1.25
diff -u -r1.25 TilesPlugin.java
--- src/share/org/apache/struts/tiles/TilesPlugin.java  14 Mar 2004 06:23:43 -0000     
 1.25
+++ src/share/org/apache/struts/tiles/TilesPlugin.java  29 Sep 2004 00:09:21 -0000
@@ -1,5 +1,5 @@
 /*
- * $Header: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/tiles/TilesPlugin.java,v 
1.25 2004/03/14 06:23:43 sraeburn Exp $
+ * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesPlugin.java,v 1.25 
2004/03/14 06:23:43 sraeburn Exp $
  * $Revision: 1.25 $
  * $Date: 2004/03/14 06:23:43 $
  *
@@ -25,6 +25,8 @@
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.UnavailableException;
+import java.util.Enumeration;
+import java.util.HashMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -268,10 +270,13 @@
         DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
         // Get init parameters from web.xml files
         try {
-            DefinitionsUtil.populateDefinitionsFactoryConfig(
-                factoryConfig,
-                servlet.getServletConfig());
-                
+            HashMap paramMap = new HashMap();
+            Enumeration e = servlet.getServletConfig().getInitParameterNames();
+            while (e.hasMoreElements()) {
+                String key = (String) e.nextElement();
+                paramMap.put(key, servlet.getServletConfig().getInitParameter(key));
+            }
+            factoryConfig.populate(paramMap);
         } catch (Exception ex) {
             if (log.isDebugEnabled()){
                 log.debug("", ex);
@@ -402,3 +407,4 @@
     }
 
 }
+

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to