Repository: struts
Updated Branches:
  refs/heads/master 6d2a57355 -> 857195c1b


Creates result before executing it to allow listeners to operate on it


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/6bb526d8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6bb526d8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6bb526d8

Branch: refs/heads/master
Commit: 6bb526d8ecae0156b9c19bbf86a151501b642f09
Parents: 954a29e
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Wed Feb 3 21:01:48 2016 +0100
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Wed Feb 3 21:01:48 2016 +0100

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/DefaultActionInvocation.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/6bb526d8/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
index d6385c6..a8dcf56 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
@@ -183,6 +183,7 @@ public class DefaultActionInvocation implements 
ActionInvocation {
     }
 
     public Result createResult() throws Exception {
+        LOG.trace("Creating result related to resultCode [{}]", resultCode);
 
         if (explicitResult != null) {
             Result ret = explicitResult;
@@ -247,7 +248,11 @@ public class DefaultActionInvocation implements 
ActionInvocation {
             // this is needed because the result will be executed, then 
control will return to the Interceptor, which will
             // return above and flow through again
             if (!executed) {
+                result = createResult();
+
                 if (preResultListeners != null) {
+                    LOG.trace("Executing PreResultListeners for result [{}]", 
result);
+
                     for (Object preResultListener : preResultListeners) {
                         PreResultListener listener = (PreResultListener) 
preResultListener;
 
@@ -354,8 +359,6 @@ public class DefaultActionInvocation implements 
ActionInvocation {
      * @throws ConfigurationException If not result can be found with the 
returned code
      */
     private void executeResult() throws Exception {
-        result = createResult();
-
         String timerKey = "executeResult: " + getResultCode();
         try {
             UtilTimerStack.push(timerKey);

Reply via email to