Results 1 to 3 of 3

Thread: Spring + AJAX + JSON

  1. #1
    Join Date
    Apr 2011
    Posts
    2

    Default Spring + AJAX + JSON

    Hi,

    Is there a way to post a JSON array object to a Spring controller using ajax?
    In controller, I like to do something like

    public @ResponseBody String doSomething(@RequestBody List<Product> productList){ ..... }

    where Product is a bean class.

    Thx in advance
    Steven

  2. #2
    Join Date
    Mar 2011
    Posts
    27

    Default

    I am having the same problem. Trying to post a json array of events to a spring controller. Does anyone know the answer to this problem?
    Thanks

  3. #3
    Join Date
    Apr 2011
    Posts
    2

    Default

    I solved the problem. You don't need bracket when you send Json array. Example, {array:"1,2,3"} instead of {array:"[1,2,3]"}. I hope it helps.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •