JsonpRequestBuilder를 사용하여 시간이 초과되었습니다.GWT JsonpRequestBuilder 시간 초과 문제
는 엔트리 포인트 코드는 다음과 같이 진행됩니다
이// private static final String SERVER_URL = "http://localhost:8094/data/view/";
private static final String SERVER_URL = "http://www.google.com/calendar/feeds/[email protected]/public/full?alt=json-in-script&callback=insertAgenda&orderby=starttime&max-results=15&singleevents=true&sortorder=ascending&futureevents=true";
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network "
+ "connection and try again.";
/**
* This is the entry point method.
*/
public void onModuleLoad() {
JsonpRequestBuilder requestBuilder = new JsonpRequestBuilder();
// requestBuilder.setTimeout(10000);
requestBuilder.requestObject(SERVER_URL, new Jazz10RequestCallback());
}
class Jazz10RequestCallback implements AsyncCallback<Article> {
@Override
public void onFailure(Throwable caught) {
Window.alert("Failed to send the message: " + caught.getMessage());
}
@Override
public void onSuccess(Article result) {
// TODO Auto-generated method stub
Window.alert(result.toString());
}
기사 클래스는 단순히 :
import com.google.gwt.core.client.JavaScriptObject;
public class Article extends JavaScriptObject {
protected Article() {};
}
GWT에서 페이지, 그러나 항상 onFailure() 콜백을 명중하고이 경고를 보여줍니다
Failed to send the message. Timeout while calling <url>.
실패
는 Eclipse 플러그인 콘솔에 아무것도를 볼 수 있습니다. 나는 URL을 시도하고 완벽하게 작동합니다. 당신이 당신의 URL에callback=insertAgenda
이 있기 때문에
이