This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!