whole_new_world whole_new_world - 2 months ago 23
Java Question

cannot import jsonarray into jsp in eclipse

I want to use JSONArray in jsp. I have imported the library like this

I also downloaded the java-json jar and paste into WEB-INF lib, please see the snapshot of my windows.


but the compiler still complains that Jsonarray cannot be resolved to a type. What could be wrong? Thank you.


The problem is that you wrote:

<%@ page import org.json.JSONArray %> 

But you should have written:

<%@ page import="org.json.JSONArray" %>