For some reason, the compiler/translator thinks that JSONObject is a package, not a class.
I thought this was a strange message, which led to my speculation. You are probably correct, but I'm not 100% convinced. I'm also guessing that the error is created during the translation from JSP to java. But again, just a guess.
Why is this code not in a servlet where it would be easier to debug? Putting Java code into a JSP is a bad practice that's been obsolete for over 16 years.
I have been working with JSP on and off for maybe 3 or 4 years now. Mostly experimenting and learning by trial and error. I was using an older text about JSP that has a lot of information and, logically, is probably organized pretty well. But frankly, it never gave a good explanation on how to develop software using java and JSP. I bought another text a few weeks ago and from a tutorial point of view the new text is better. I would not recommend either text. I have not finished it yet, but I have already seen that writing servlets in java is the direction that I want to move. I could go on and on about how poorly JSP is documented, but I won't.
Anyway, thank you for your comment. It truly reinforces my thoughts about moving to servlets. I had not even thought about servlets making debugging easier. Since I work almost entirely on my own, improved debugging is VERY important to me. I spend far too much time debuggying, not developing. Historically, I'm a C/C++ and java developer and debugging software was never a major problem for me. Debugging in web site development is truly a different ball game. I'm going to start re-writing my examples, including this example, using servlets.
I am going to leave this
thread open. Hopefully, after the weekend, I will return to close the issue, or to provide a re-written testcase.
Regards,
Jim