title: Sending values from localStorage to java servlet
body: <p>I have a form which takes input from the user and stores all the values inside an array as JSON objects to localStorage. On another page all of these objects are displayed in their own seperate table. I need to send all those values displayed on  the second page, which are grabbed from localStorage, to a java servlet to be later inserted into the database. This is how I am generating the table :</p>
  
  <pre><code>&lt;tbody id = "shoppingcart2"&gt; //html code to where the jquery output is printed
                      &lt;/tbody&gt;
  
  
     for (var i in cartArray){ //loops through each item in the array and creates its own &lt;tr&gt; with the values.
          outputProduct2 += 
          "&lt;tr&gt;"
          +"&lt;td data-name='name'&gt;"
          + "VM Naam: "
          + cartArray[i].vmnaam + ""
          +"&lt;/br&gt;"
          +cartArray[i].name + ""
          +"&lt;/br&gt;"
          +"ram:"
          +cartArray[i].ram
          +"&lt;/br&gt;"
          +"diskSpace:"
          +cartArray[i].diskSpace
          +"&lt;/br&gt;"
          +"cpu:"
          +cartArray[i].cpu
          +"&lt;/td&gt;"
          +"&lt;td data-price='Price'&gt;"
          +cartArray[i].price
          +"&lt;/td&gt;"
          +"&lt;td data-quantity='Quantity'&gt;"
          +cartArray[i].quantity
          +"&lt;td data-name='subtotal' class='text-center'&gt;"
          +cartArray[i].total
          +"&lt;/td&gt;"
          +"&lt;/tr&gt;"
      }
  
  
  $("#shoppingcart2").html(outputProduct2); // jquery is printed to html id shoppingcart2
  </code></pre>
  
  <p>The localstorage looks as following:</p>
  
  <pre><code>[{"id":2,"vmnaam":"b","name":"Windows Server 2012","price":"25.00","quantity":1,"ram":4,"diskSpace":30,"cpu":1},{"id":3,"vmnaam":"ba","name":"Windows Server 2012","price":"57.50","quantity":1,"ram":6,"diskSpace":70,"cpu":4}]
  </code></pre>