
Untitled
By: a guest on
Jul 4th, 2012 | syntax:
None | size: 1.12 KB | hits: 17 | expires: Never
GWT RequestBuilder problem
String url = "http://localhost:8080/my-spring-example/hello.htm";
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
RequestCallback callback = new RequestCallback() {
public void onError(Request request, Throwable exception) {
spring.setHTML("Die Daten konnten nicht geladen werden");
}
public void onResponseReceived(Request request, Response response) {
String responseAsText = response.getText();
if (responseAsText.equals("") || responseAsText == null ){
spring.setHTML("Der String ist leer");
} else {
spring.setHTML(responseAsText);
}
}
};
try {
rb.sendRequest(null, callback);
} catch (RequestException e) {
e.printStackTrace();
}
<head><title>Hello :: Spring 3 Application</title></head>
<body>
<h1>Hello World, Spring 3.0!</h1>
<p>Es gibt 32 Einträge</p>
</body>
<head><title>Hello :: Spring 3 Application</title></head>n
<body>n
t<h1>Hello World, Spring 3.0!</h1>n
t<p>Es gibt 32 Eintr344ge</p>n
</body>
<head><title>Hello :: Spring 3 Application</title></head>n
<body>n
t<h1>Hello World, Spring 3.0!</h1>n
t<p>Es gibt 32 Eintr344ge</p>n
</body>