我目前正在尝试在 Play Framework 中导入简单的对象,例如 JSON,但我不断收到错误消息。有人知道如何避免这种情况吗?
这是我的代码:
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.codehaus.jackson.JsonNode;
import com.fasterxml.jackson.databind.JsonNode;
import views.html.*;
public class Application extends Controller {
public static Result index() {
return ok(index.render("Your new application is ready."));
}
// Step where the information is READ
public static JSONObject get(){
JSONObject obj = null; //get json object from localhost:9000
return obj;
}
}
我得到的错误是:
C:\Users\eedcoro\activator-1.2.2-minimal\manager\app\controllers\Application.java:5package
org.json does not exist
import org.json.JSONArray;
^
C:\Users\eedcoro\activator-1.2.2-minimal\manager\app\controllers\Application.java:6package
org.json does not exist
import org.json.JSONException;
^
C:\Users\eedcoro\activator-1.2.2-minimal\manager\app\controllers\Application.java:7package org.json does not exist
import org.json.JSONObject;
^