When I click the button, I send some data to the server and redirect it to another page. I used RequestBuilder, but it is waiting for a response and, of course, get it. And nothing happens, the same page remains. I see that you should not use RequestBuidler here ... What should I use to publish data and redirect capabilities?
In spring
@RequestMapping(method=RequestMethod.POST, value="/ddd")
public ModelAndView processOrder(@RequestBody String orderInString, HttpSession session) throws Exception{
...
return new ModelAndView(new RedirectView("abc"));
}
In gwt
public void postData(final String data, final String url) {
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
try {
builder.sendRequest(data, new RequestCallback() {
public void onError(Request request, Throwable exception) {
...
}
public void onResponseReceived(Request request,
Response response) {
if (200 == response.getStatusCode()) {
..
} else {
..
}
}
});
} catch (RequestException e) {
...
}
return;
}
source
share