How to Redirect in GWT from one link to another?

4,617 views
Skip to first unread message

insaneyogi

unread,
Apr 9, 2008, 4:22:40 PM4/9/08
to Google Web Toolkit
Hello,
Can anybody tell me how I can achieve redirecting of
URL's . suppose I have a URL

http://mything.tellme.com/

I want to redirect this to

http://mything.tellme.com/mything


Is there any way of doing so ?

With Regards
-S

Peter Blazejewicz

unread,
Apr 9, 2008, 5:24:48 PM4/9/08
to Google Web Toolkit
hi,
Personally I would use gwt Form submission for that (for various
reason), however you can use redirect that way I think:

public void onModuleLoad() {
redirect(GWT.getModuleBaseURL()+"mything");
}

native void redirect(String url)
/*-{
$wnd.location.replace(url);
}-*/;


for more use search feature, people already asked similar questions,

regards,
Peter

walden

unread,
Apr 10, 2008, 7:58:55 AM4/10/08
to Google Web Toolkit
Do you literally mean redirect? That's a server thing, not GWT
really.

An html document with a meta tag in the header can make [most]
browsers redirect to another url.

The server at http://mything.tellme.com/ can respond with a redirect
status and a new location.

Or do I not understand the question?

Walden

darkflame

unread,
Apr 10, 2008, 11:03:18 AM4/10/08
to Google Web Toolkit
if you want the user to goto a url, use;

Window.open(linkURL, "_self", "");

Where linkURL is the path you want to goto.

You need to have;
import com.google.gwt.user.client.Window;

At the top of your code, of course.
Reply all
Reply to author
Forward
0 new messages