Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Writing JSON data back to client

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am following the steps given here to create an AJAX application using Dojo.

I have a java object : PaneLayout which I convert to JSONObject


In my JSP:


In CreateForm servlet:

I am sending back the string form of JSONObject (created by converting a PaneLayout object, as shown above)



The 'getPaneInfo(id)' function is called and it sends the request to servlet alright but no data is coming in showProperty function. I checked the value of 'data' and that is 'false'. So each time 'Damn' is getting printed.

I don't understand what can be wrong in this. Am I doing anything wrong while sending the data? What else can be wrong?

Please help me with this. Any pointers will help.

Thanks.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you used a tool like Firebug to see what is being returned as the response of the Ajax request?
 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that suggestion Bear. I used Firebug to monitor the entire call.

And I could solve the error also.
In my servlet I was doing "response.sendRedirect(sSendTo);" to the JSP. Removing it worked!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic