JSON Response is not getting in Android from google app engine servlet -


I am trying to apply an HTTP request response from the Android to GAe Servlet. Requesting from Android is the normal http post request. It's working fine The problem is that I'm sending back Android to Jason's response. I created Jason Ojjest using GSN (GSN v2.2.2) When I tested in the browser, it shows the GSN format correctly.

Jason,

  {"data1": 100, "data2": "hello", "list": ["string 1", "string 2" , "String 3"]}   

I tried to send this json

  / * Json is my Jason format / response.getWritet () . Println (json);   

and

  system.out.println (json);   

When I try to read Jason object in Android then I'm getting an exception,

  value < Html & gt; & Lt; Head & gt; Java.lang.String can not be converted to JSONArray   

Please suggest some other ways or help me fix it, thanks.

Your page is inserting the HTML code ( & lt; html & gt; & lt ; Head & gt; ) Either enter all the HTML and then process JSON (perhaps you can find it easy by putting a JSON in a special container), or do not output any HTML and only do not output JSON Please.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -