私がここで説明したように私PlayNプロジェクトにHTTPリクエストを行うためにRequestBuilderを使用したい: http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequestsHTTPリクエスト
私は私のモジュールのXMLファイルにタグを追加しました:
が、私はまだ次のコンパイル・エラーがあります。
輸入com.googleが
を解決することはできません私は私のプロジェクトをコンパイルするためにやるべき何か他のものがありますか?
import com.google.gwt.http.client.*;
...
String url = "http://www.myserver.com/getData?type=3";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url));
try {
Request request = builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// Couldn't connect to server (could be timeout, SOP violation, etc.)
}
public void onResponseReceived(Request request, Response response) {
if (200 == response.getStatusCode()) {
// Process the response in response.getText()
} else {
// Handle the error. Can get the status text from response.getStatusText()
}
}
});
} catch (RequestException e) {
// Couldn't connect to server
}
Canコンパイルエラーが文句を言っている完全なimportステートメントを投稿しますか?あなたがどこかの依存関係を逃しているように私に聞こえます... – hatboyzero
クラスパスにgwt-user jarがありますか? – hatboyzero