This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

How to generate JavaScript JSON object with jQuery?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First below codes are my spring RESTful Server controller class.



And the following codes are Ajax Java script with jquery.



The in java script prints below value.



But in restcontroller prints the following value.



I am afraid the generated json value of jquery javascript bring some error. But I hava no idea how to make proper json type value.
Any idea will be deeply appreciated. Thansk.
 
Marshal
Posts: 67388
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSON.stringify() is not a jQuery API, so if there were an error in generating the JSON (unlikely), the problem would not be with jQuery.

If this were my problem I'd be using the browser tools to see the request that is being sent to make sure that it contains what is expected. If it does not, then the problem would be somewhere on the front end while generating the request. If the request is as expected, the problem is likely on the back-end, perhaps with the REST mappings.
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic