Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2209

JSONObject response contains additional {}

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0.11
    • 5.0.11
    • Framework
    • None
    • java version "1.6.0_01"
      Linux penfold 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux
      Tapestr 5.0.11-SNAPSHOT

    Description

      If an event handler returns a JSONObject the response received on the client contains an additional pair of brackets.

      An example:

      Object onUpdate() {
      ....
      JSONObject json = new JSONObject();
      json.put("fcId", fcId);
      return json;
      }

      This works fine, but on the client side I get:

      onComplete : function(transport) {
      var response = transport.responseText;
      // if (response.length>2 && response.endsWith("{}"))
      // response = response.substring(0,response.length-2);
      var reply = response.evalJSON(true);
      ....
      }

      The responseText contains

      {"fcId":36178}

      {}

      Thanks,

      Adriaan

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            adriaanjoubert Adriaan Joubert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: