JSON prob in tomcat 5.5


am trying to recreate JSON example here
in my tomcat 5.5…

managed to find json.jar here,

get this error on JSP:
org.apache.jasper.JasperException: /ReceiveJSON.jsp(2,26) equal symbol expected

what is causing this error please…

JSP code:


<%@ page import="java.net.*
<%@ page import=“org.json.*”%>
try {

	URLDecoder decoder = new URLDecoder();
	String strJSON = decoder.decode(request.getParameter("strJSON"));
	JSONObject objJSON = (JSONObject) JSONValue.parse(strJSON);
	String Message = objJSON.get("msg").toString();
	if (Message.equals("Hi There!"))   {
		out.println("And hi there to you!");
	} else {
		out.println("Later Gator!");
catch (Exception e) {


thank you…

oh brother, what a jerk… ok, corrected errors in directives…

put back orig directives he has in his example, namely:
<%@ page language=“java” contentType=“text/html; charset=ISO-8859-1” pageEncoding=“ISO-8859-1” import=“java.net.,org.json.simple.”%>

(again, this is from this example:
(also have prototype.js in proper location in html file, which is used for ajax request…)

NOW get this error:

An error occurred at line: 13 in the jsp file: /ReceiveJSON.jsp
JSONObject cannot be resolved to a type
11: URLDecoder decoder = new URLDecoder();
12: String strJSON = decoder.decode(request.getParameter(“strJSON”));
13: JSONObject objJSON = (JSONObject) JSONValue.parse(strJSON);
15: String Message = objJSON.get(“msg”).toString();

when click on 2nd button (IF I have already clicked on other button), get this error:

org.apache.jasper.JasperException: Unable to load class for JSP

java.lang.ClassNotFoundException: org.apache.jsp.ReceiveJSON_jsp


have json.jar in WEB-INF/lib

thank you…

I’m having the same issue. Did you get any solution for this issue?