title: Error Reading JSON Object in JSP when passed using jquery
body: <p>I want to create a json object in jquery and process it in jsp and return back in json format. 
  I created a json object and posted to a jsp file:</p>
  
  <pre><code>$.post("processDropDown.jsp", $('#fields tr td input').serializeArray(),
  function(data) {
  alert(data);
  });
  </code></pre>
  
  <p>In jsp file i read the parameters and put in jsonobject, but json exception-null object exception is returned.  </p>
  
  <pre><code>JSONObject inp = new JSONObject();
  Enumeration enumeration = request.getParameterNames();
  try {
      while (enumeration.hasMoreElements()) {
          String parameterName = (String) enumeration.nextElement();
          out.print("\nParameter = " + parameterName+"\n");
          inp = inp.getJSONObject(request.getParameter(parameterName));
          out.print("::" + inp.toString());
      }
  } catch(Exception ex) {
      out.print(ex);
  }
  </code></pre>
  
  <p>The JSON.stringify() method returns the following output in client before i pass it to the jsp.</p>
  
  <pre><code>JSON.stringify($('#fields tr td input').serializeArray());
  
  [{"name":"valueField","value":"12"},{"name":"textField","value":"Twelve"},{"name":"valueField","value":"34"},{"name":"textField","value":"ThirtyFour"}]
  </code></pre>