• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending & receiving 2d arrays from jersey to javascript  RSS feed

 
Ranch Hand
Posts: 205
13
Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a 2 dimensional array of strings in javascript, ie an array of arrays, that I'm wanting to fill with data that I GET from the server, update in javascript code and then PUT back.

It seems that to do this in Jersey, in my java code, I have to wrap the array in an object.


and make the object wrapping my String[][] available via http

When my String[][] looks like this:

doing a GET on the resource results in

Then, in my javascript code, I have to have functions that 'unwrap' the json into an array. Another js function does the opposite, takes a 2d array and returns an object that can be PUT back to the server.


This all works! However, I'm thinking that manually wrapping & unwrapping is just too much work and maybe jersey is somehow capable of doing it for me.

Is there a better technique?
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!