Tapestry
  1. Tapestry
  2. TAPESTRY-2209

JSONObject response contains additional {}

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.11
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      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

        Activity

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Adriaan Joubert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development