You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Kai Lilleby (Created) (JIRA)" <de...@tapestry.apache.org> on 2012/02/21 15:40:34 UTC

[jira] [Created] (TAPESTRY-2789) AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return

AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return
------------------------------------------------------------------------------

                 Key: TAPESTRY-2789
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2789
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
         Environment: WebSphere on linux, and Jetty on osx
            Reporter: Kai Lilleby
            Priority: Blocker


In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 

My guess would be that the following block of code:
-------------
        if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
        {
            partialRenderer.renderPartialPageMarkup();
            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.

        JSONObject reply = new JSONObject();

        resultProcessor.processResultValue(reply);
}
---------------
should be replaced with:
--------------- 
       if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.

        JSONObject reply = new JSONObject();

        resultProcessor.processResultValue(reply);
}
------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (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

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1854:
---------------------------------------

    Summary: AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response  (was: AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return)
    
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Moved] (TAP5-1854) AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return

Posted by "Howard M. Lewis Ship (Moved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship moved TAPESTRY-2789 to TAP5-1854:
------------------------------------------------------

    Component/s:     (was: tapestry-core)
                 tapestry-core
            Key: TAP5-1854  (was: TAPESTRY-2789)
        Project: Tapestry 5  (was: Tapestry)
    
> AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return
> ------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (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

Posted by "Howard M. Lewis Ship (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1854.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.4
                   5.3.3
    
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>             Fix For: 5.3.3, 5.4
>
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (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

Posted by "Howard M. Lewis Ship (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1854:
---------------------------------------

    Summary: AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response  (was: AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return)
    
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13215287#comment-13215287 ] 

Hudson commented on TAP5-1854:
------------------------------

Integrated in tapestry-5.3-freestyle #12 (See [https://builds.apache.org/job/tapestry-5.3-freestyle/12/])
    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 (Revision 1293020)

     Result = SUCCESS
hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1293020
Files : 
* /tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java

                
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>             Fix For: 5.3.3, 5.4
>
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (TAP5-1854) AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return

Posted by "Howard M. Lewis Ship (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-1854:
------------------------------------------

    Assignee: Howard M. Lewis Ship
    
> AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return
> ------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (TAP5-1854) AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return

Posted by "Howard M. Lewis Ship (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-1854:
------------------------------------------

    Assignee: Howard M. Lewis Ship
    
> AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return
> ------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (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

Posted by "Howard M. Lewis Ship (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1854.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.4
                   5.3.3
    
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>             Fix For: 5.3.3, 5.4
>
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Moved] (TAP5-1854) AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return

Posted by "Howard M. Lewis Ship (Moved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship moved TAPESTRY-2789 to TAP5-1854:
------------------------------------------------------

    Component/s:     (was: tapestry-core)
                 tapestry-core
            Key: TAP5-1854  (was: TAPESTRY-2789)
        Project: Tapestry 5  (was: Tapestry)
    
> AjaxComponentEventRequestHandler adds a new JSONObject to my JSONObject return
> ------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Priority: Blocker
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13215287#comment-13215287 ] 

Hudson commented on TAP5-1854:
------------------------------

Integrated in tapestry-5.3-freestyle #12 (See [https://builds.apache.org/job/tapestry-5.3-freestyle/12/])
    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 (Revision 1293020)

     Result = SUCCESS
hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1293020
Files : 
* /tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AjaxComponentEventRequestHandler.java

                
> AjaxComponentEventRequestHandler doesn't handle the case where a response has already be returned, and may append an empty JSON Object to the response
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1854
>                 URL: https://issues.apache.org/jira/browse/TAP5-1854
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>         Environment: WebSphere on linux, and Jetty on osx
>            Reporter: Kai Lilleby
>            Assignee: Howard M. Lewis Ship
>            Priority: Blocker
>             Fix For: 5.3.3, 5.4
>
>
> In committ 1155178 the removal of "if (resultProcessorInvoked.get()) return" seems to have reintroduced an old issue (#TAPESTRY-2619).
> When running on a Servlet engine that does not honor HttpResponse.getOutputStream().close() - i.e. subsequent writing to the responses outputstream will be written to the client - which is true for WebSphere but not for Jetty, the final line in AjaxComponentEventRequestHandler will write an new jsonobject to the response, resulting in an invalid json structure. 
> My guess would be that the following block of code:
> -------------
>         if ((!resultProcessorInvoked.get()) && queue.isPartialRenderInitialized())
>         {
>             partialRenderer.renderPartialPageMarkup();
>             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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ---------------
> should be replaced with:
> --------------- 
>        if ((!resultProcessorInvoked.get()) && 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 (resultProcessorInvoked.get()) 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.
>         JSONObject reply = new JSONObject();
>         resultProcessor.processResultValue(reply);
> }
> ------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira