hi, trying to add a timeout to the greeting service.
there does not seem to ne any way to add a timeout on the client
stide, so i am trying a request builder using this example:
http://jagadesh4java.blogspot.com/2009/04/gwt-rpc-using-request-builder-hi.html
the server complains using the code below with a:
javax.servlet.ServletException: Content-Type was 'text/plain;
charset=utf-8'. Expected 'text/x-gwt-rpc'.
is there a way to set the content type on the client side?
thanks
private void send(final String string, final Label label) {
RequestCallback requestCallback;
RequestBuilder builder;
final int STATUS_CODE_OK = 200;
final String request = GWT.getModuleBaseURL() + "greet?input=" + string;
requestCallback = new RequestCallback() {
public void onError(Request request, Throwable exception) {
exception.printStackTrace();
}
public void onResponseReceived(Request request, Response response) {
if (response.getStatusCode() == STATUS_CODE_OK) {
Log.info("it worked: " + response);
sleep(2000);
if (label != null)
label.setText(response.getText());
} else
Log.info("bad news: " + response);
}
};
try {
builder = new RequestBuilder(RequestBuilder.POST, request);
//builder.setTimeoutMillis(60000);
builder.sendRequest(null, requestCallback);
} catch (RequestException e) {
throw new RuntimeException(e);
}
---
co-chair http://ocjug.org/
--
You received this message because you are subscribed to the Google Groups "Google
Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.