3

I created a simplehashmap using the accepted solution in this question: How to create a simple map using JavaScript/JQuery

I however need to send this var to a servlet and retrieve them onto a Java HashMap. How do I do that.

The key is a string while the value is an array, say like:

`[1,'apple,orange, banana'],[2,'apple,peach, banana']` ...

I need the keys 1,2 and the array loaded onto a Java HashMap.

I tried to post it using jquery. where selectedrows is my map

$.post(url, { id: selectedrows });
Community
  • 1
  • 1
Haran Murthy
  • 341
  • 2
  • 10
  • 30
  • I edited the post to include my jquery .post command, but how do i identify it as a map on the java side and retrieve both key and value – Haran Murthy Jul 30 '12 at 17:19

1 Answers1

1

I creates a JSON string and then sent it via an ajax post to the servlet and build the HashMap there.

Haran Murthy
  • 341
  • 2
  • 10
  • 30