You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by pb...@apache.org on 2007/07/04 06:12:12 UTC

svn commit: r553061 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/ActionResources.properties action/ActionResources_ja.properties action/RequestProcessor.java chain/commands/servlet/CreateAction.java config/ActionConfig.java

Author: pbenedict
Date: Tue Jul  3 21:12:11 2007
New Revision: 553061

URL: http://svn.apache.org/viewvc?view=rev&rev=553061
Log:
STR-1809: Add ActionConfig to log message when action cannot instantiate

Modified:
    struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties
    struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties
    struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java
    struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java
    struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties?view=diff&rev=553061&r1=553060&r2=553061
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties Tue Jul  3 21:12:11 2007
@@ -13,7 +13,7 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-actionCreate=No action instance for path {0} could be created
+actionCreate=No action instance for path \'{0}\' could be created from action config: {1}
 applicationLoading=Loading application resources from resource {0}
 applicationResources=Cannot load application resources bundle {0}
 configCompleted=Verification of ModuleConfig has been completed

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties?view=diff&rev=553061&r1=553060&r2=553061
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties Tue Jul  3 21:12:11 2007
@@ -13,7 +13,7 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-actionCreate=\u30D1\u30B9 {0} \u306B\u5BFE\u3059\u308B\u30A2\u30AF\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093
+actionCreate=\u30D1\u30B9 \'{0}\' \u306B\u5BFE\u3059\u308B\u30A2\u30AF\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093: {1}
 applicationLoading={0} \u304b\u3089\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30ea\u30bd\u30fc\u30b9\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059
 applicationResources=\u30ea\u30bd\u30fc\u30b9\u30d0\u30f3\u30c9\u30eb {0} \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093
 configCompleted=ModuleConfig\u306E\u691C\u8A3C\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=diff&rev=553061&r1=553060&r2=553061
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java Tue Jul  3 21:12:11 2007
@@ -284,7 +284,7 @@
                 // instead of returning null.
             } catch (Exception e) {
                 log.error(getInternal().getMessage("actionCreate",
-                        mapping.getPath()), e);
+                        mapping.getPath(), mapping.toString()), e);
 
                 response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                     getInternal().getMessage("actionCreate", mapping.getPath()));

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java?view=diff&rev=553061&r1=553060&r2=553061
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java Tue Jul  3 21:12:11 2007
@@ -50,6 +50,10 @@
     protected synchronized Action getAction(ActionContext context, String type,
         ActionConfig actionConfig)
         throws Exception {
+
+        ServletActionContext saContext = (ServletActionContext) context;
+        ActionServlet actionServlet = saContext.getActionServlet();
+
         ModuleConfig moduleConfig = actionConfig.getModuleConfig();
         String actionsKey = Constants.ACTIONS_KEY + moduleConfig.getPrefix();
         Map actions = (Map) context.getApplicationScope().get(actionsKey);
@@ -65,15 +69,19 @@
             action = (Action) actions.get(type);
 
             if (action == null) {
-                action = createAction(context, type);
+                try {
+                    action = createAction(context, type);
+                } catch (Exception e) {
+                    log.error(actionServlet.getInternal().getMessage(
+                            "actionCreate", actionConfig.getPath(), 
+                            actionConfig.toString()), e);
+                    throw e;
+                }
                 actions.put(type, action);
             }
         }
 
         if (action.getServlet() == null) {
-            ServletActionContext saContext = (ServletActionContext) context;
-            ActionServlet actionServlet = saContext.getActionServlet();
-
             action.setServlet(actionServlet);
         }
 

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java?view=diff&rev=553061&r1=553060&r2=553061
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java Tue Jul  3 21:12:11 2007
@@ -1384,6 +1384,7 @@
             sb.append(type);
         }
 
+        sb.append("]");
         return (sb.toString());
     }
 }