title: Submit a JSON string to a JSP page via AJAX/jQuery
body: <p>OK, so the title basically says what I want to do. For the past few hours, I've been trying to use jQuery.post to submit a JSON string to a JSP page. So my Javascript for the file <em>iMakeTheJSONstring.jsp</em> looks like:</p>
  
  <pre><code>    jsonString = new Object();
      jsonString.user = username;
      jsonString.field = textBoxId.replace(/[0-9]/g,"").replace("input","");
      jsonString.data = document.getElementById(textBoxId).value;
      var toSubmit = JSON.stringify(jsonString);
  </code></pre>
  
  <p>I've tested these lines of code by outputting toSubmit to an alert box. These lines build the JSON string correctly. However, the next line's giving me a lot of trouble:</p>
  
  <pre><code>//"info" is simply a reiteration of the original JSON string sent to update.jsp    
  $.post("http://localhost:8080/armControl/admin/update.jsp", toSubmit, function(info) {
                      alert(info);
  </code></pre>
  
  <p>At the moment, update.jsp is only as follows:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;%
  out.print("hello");
  %&gt;
  </code></pre>
  
  <p>Even this doesn't return a value for "info," and I don't get an alert box to pop up.</p>
  
  <p>I had previously tried to access the information with</p>
  
  <pre><code>String randomVar = request.getParameter("whatever").toString();
  </code></pre>
  
  <p>However, this isn't working.</p>
  
  <p>I really appreciate your reading my post, and I will certainly appreciate any thoughts you have on my problem. I'm new to Java/JSP, and this whole issue is exhausting to me!</p>