0

I have downloaded json-rpc-1.0 jar and this is an example that I found in a web page

import org.json.JSONObject;

...
...

JSONObject json = new JSONObject();
json.put("city", "Mumbai");
json.put("country", "India");

...

String output = json.toString();

I just wanna know how to import this jar to my jsp

I got something like this <%@page import="org.json.JSONObject.*" %> but I don't have any idea of what I'm doing

Someone can tell me how it works this library? an easy example or a web page with docs about that

zickno
  • 115
  • 1
  • 3
  • 10

1 Answers1

0

As you in *.java file you import the class when you need. Same is applied in jsp pages. You can write the java code within <% %>. It works like you are writing the code in your servlet's method.

You can go through this page http://www.json.org/javadoc/ for JSONObject information and you can see http://www.jsptut.com/scriptlets.jsp for jsp's scriplets.

Pradeep Kr Kaushal
  • 1,506
  • 1
  • 16
  • 29