我想通过我的GWT应用程序中的servlet获取请求。在编译代码时,我收到了这些错误。没有源代码可用于输入:GWT编译错误
[ERROR] Line 16: No source code is available for type org.apache.http.client.ClientProtocolException; did you forget to inherit a required module?
[ERROR] Line 16: No source code is available for type org.apache.http.ParseException; did you forget to inherit a required module?
[ERROR] Line 16: No source code is available for type org.json.simple.parser.ParseException; did you forget to inherit a required module?
我该怎么做才能消除这些错误? GWT不支持这些类吗?
以下是我使用
public String getJSON() throws ClientProtocolException, IOException, ParseException{
HttpClient httpclient = new DefaultHttpClient();
JSONParser parser = new JSONParser();
String url = "some - url - can't disclose";
HttpResponse response = httpclient.execute(new HttpGet(url));
JSONObject json_data = (JSONObject)parser.parse(EntityUtils.toString(response.getEntity()));
JSONArray results = (JSONArray)json_data.get("result");
}
此代码工作正常的代码,如果我用这个在通常的Java项目/控制台应用程序。