I have a simple web form written in Google web toolkit. I want the user to follow a new URL when he clicks on the submit button. However I cannot find any examples of redirecting the user to a new URL from within GWT code. How may I achieve this?
the exact answer is:
form.getElement().<FormElement>cast().setTarget("");
by this line you changing the target parameter of the form and now the main page redirected to the action url.
be careful that Window.Location.assign() makes a new GET request after your main POST request!, So it is not the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With