You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/02/24 00:08:34 UTC

svn commit: r1293020 - /tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java

Author: hlship
Date: Thu Feb 23 23:08:33 2012
New Revision: 1293020

URL: http://svn.apache.org/viewvc?rev=1293020&view=rev
Log:
TAP5-1854: AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response


Modified:
    tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java

Modified: tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java?rev=1293020&r1=1293019&r2=1293020&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java (original)
+++ tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java Thu Feb 23 23:08:33 2012
@@ -122,12 +122,18 @@ public class AjaxComponentEventRequestHa
         // but it's still possible that we still want to do a partial page render ... if filters were added to the render queue.
         // In that event, run the partial page render now and return.
 
-        if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
+        boolean wasInvoked = resultProcessorInvoked.get();
+
+        if ((!wasInvoked) && queue.isPartialRenderInitialized())
         {
             partialRenderer.renderPartialPageMarkup();
             return;
         }
 
+        // If the result processor was passed a value, then it will already have rendered, and there is nothing more to do.
+
+        if (wasInvoked) { return; }
+
         // Send an empty JSON reply if no value was returned from the component event handler method.
         // This is the typical behavior when an Ajax component event handler returns null.