Forums Register Login
Sending & receiving 2d arrays from jersey to javascript
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?
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:

This thread has been viewed 200 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 17, 2018 22:21:43.