0

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

"vslText": "[field1] = '12345678'"

Now to send it to the REST as a string I've tried

String jsonRequest = "{ 'vslText' : '[field1] = " + "" 

But I get lost in all the quotes.

I tried using

JSONObject jsonRequest = new JSONObject();
jsonRequest.put("vslText", "[field1] = '12345678'");

but I get this error

An error occurred at line: 18 in the jsp file: /jsp/javaServlet/IDsearch.jsp
JSONObject cannot be resolved to a type

Here is my import clause

    <%@ page import="java.util.*" %>
    <%@ page import= "java.io.*"  %>
    <%@ page import= "java.net.*" %>
    <%@ page import= "org.json.JSONObject" %>

Please give me direction?

Crash667
  • 343
  • 2
  • 16

1 Answers1

0

Using eclipse I was able to add the .jar to the list of libraries the web app could see. Basically right click on the project and select build path then configure build path. From there, you can go to the libraries tab and add JARS using the interface.

After re-exporting it as a war file this seemed to work.

Crash667
  • 343
  • 2
  • 16