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/02/23 06:26:01 UTC
svn commit: r510835 - in
/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands:
AbstractCreateAction.java servlet/CreateAction.java
Author: pbenedict
Date: Thu Feb 22 21:26:01 2007
New Revision: 510835
URL: http://svn.apache.org/viewvc?view=rev&rev=510835
Log:
STR-3008: Added createAction method
Modified:
struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/AbstractCreateAction.java
struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java
Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/AbstractCreateAction.java
URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/AbstractCreateAction.java?view=diff&rev=510835&r1=510834&r2=510835
==============================================================================
--- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/AbstractCreateAction.java (original)
+++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/AbstractCreateAction.java Thu Feb 22 21:26:01 2007
@@ -117,4 +117,18 @@
protected abstract Action getAction(ActionContext context, String type,
ActionConfig actionConfig)
throws Exception;
+
+ /**
+ * <p>Invoked by <code>getAction</code> when the <code>Action</code>
+ * actually has to be created. If the instance is already created and
+ * cached, this method will not be called. </p>
+ *
+ * @param context The <code>Context</code> for this request
+ * @param type Name of class to instantiate
+ * @return Instantiated Action class
+ * @throws Exception if there are any problems instantiating the Action
+ * class.
+ * @since Struts 1.3.7
+ */
+ protected abstract Action createAction(ActionContext context, String type);
}
Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java
URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java?view=diff&rev=510835&r1=510834&r2=510835
==============================================================================
--- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java (original)
+++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java Thu Feb 22 21:26:01 2007
@@ -65,8 +65,7 @@
action = (Action) actions.get(type);
if (action == null) {
- log.info("Initialize action of type: " + type);
- action = (Action) ClassUtils.getApplicationInstance(type);
+ action = createAction(context, type);
actions.put(type, action);
}
}
@@ -79,5 +78,10 @@
}
return (action);
+ }
+
+ protected Action createAction(ActionContext context, String type) throws Exception {
+ log.info("Initialize action of type: " + type);
+ return (Action) ClassUtils.getApplicationInstance(type);
}
}