• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

How to generate JavaScript JSON object with jQuery?

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67644
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
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.
 
pie. 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