How to redirect an exception in backend to a error page in GWT defined into gwt.xml

Go To StackoverFlow.com

0

I don't know who to do this in gwt, I remember that I can define this in web.xml but I'm not sure about it.

Thanks

2012-04-04 19:51
by javoros


0

If you're using GWT's RPC to communicate with the server and the method that may throw an Exception declares it (void method() throws ...Exception) in the Service interface (the one that extends GWT's RemoteService), then you can catch the Exception in the onFailure(Throwable caught) method of your RPC callback and from there, take the appropriate action... if you want to redirect the user to another page, you could do:

Window.Location.assign(GWT.getHostPageBaseURL() + ERROR_PAGE);
2012-04-04 22:53
by Renato
Ads