title: How to get attributes in Json String in servlet
body: <p>How can I get each attribute within a Json String?</p>
  
  <p>I got the Json by converting first my array of objects in JavaScript via JSON.stringify. Afterwards I used ajax to pass the string to my servlet.</p>
  
  <p>Servlet Code:</p>
  
  <pre><code>String data = request.getParameter("jsonData");       
  System.out.println("json data: " + data);
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>[{"courseID":"1","codePI":"PO-BSINSYS-02.01","curriculumID":"3"},
  {"courseID":"2","codePI":"PO-BSINSYS-02.02","curriculumID":"3"}]
  </code></pre>
  
  <p>What I want is to get the individual values of the json so that I can assign them later to my object.</p>
  
  <p>E.g.</p>
  
  <pre><code>ArrayList&lt;Curriculum&gt; arrCur = new ArrayList&lt;&gt;();
      for (int x = 0; x &lt; array.size(); x++) {
          Curriculum cur = new Curriculum();
          cur.setCourseID(courseID[x]);
          cur.setCodePO(codePI[x]);
          cur.setCurriculumID(curriculumID[x]);
          arrCur.add(cur);
      }
  </code></pre>