Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect a GWT app from the client side?

Tags:

java

servlets

gwt

As you may know, res.sendRedirect(url) on the servlet side does not work because the GWT client does not process it.

Does anybody knows how to do this?

Thanks you. Daniel

like image 433
user198313 Avatar asked Dec 29 '22 18:12

user198313


1 Answers

Window.Location.assign(newUrl)

But in general, you want to avoid doing so, because you would loose all client state. You are better off changing the view via code, and then updating History (which updates the fragment url - the portion of the url after #).

like image 69
Sripathi Krishnan Avatar answered Dec 31 '22 15:12

Sripathi Krishnan