title: Making a JSON string or object in JSP
body: <p>This is what I thought a very simple issue. Basically I am trying to send a json string to a REST API service. Here is the JSON they supply</p>
  
  <pre><code>"vslText": "[field1] = '12345678'"
  </code></pre>
  
  <p>Now to send it to the REST as a string I've tried </p>
  
  <pre><code>String jsonRequest = "{ 'vslText' : '[field1] = " + "" 
  </code></pre>
  
  <p>But I get lost in all the quotes.</p>
  
  <p>I tried using </p>
  
  <pre><code>JSONObject jsonRequest = new JSONObject();
  jsonRequest.put("vslText", "[field1] = '12345678'");
  </code></pre>
  
  <p>but I get this error</p>
  
  <pre><code>An error occurred at line: 18 in the jsp file: /jsp/javaServlet/IDsearch.jsp
  JSONObject cannot be resolved to a type
  </code></pre>
  
  <p>Here is my import clause</p>
  
  <pre><code>    &lt;%@ page import="java.util.*" %&gt;
      &lt;%@ page import= "java.io.*"  %&gt;
      &lt;%@ page import= "java.net.*" %&gt;
      &lt;%@ page import= "org.json.JSONObject" %&gt;
  </code></pre>
  
  <p>Please give me direction? </p>