سؤال

I want to redirect to a external webpage but I don't know how to do that because in the EntryPoint I don't have Request and Response like in HttpServlets.

How can I do that?

هل كانت مفيدة؟

المحلول

In GWT you can use Window.Location.assign(url) to redirect browser to a new URL. Note: browser will load new URL and your GWT app will be closed (and all data and state lost).

نصائح أخرى

This doesn't work?

package test;

import java.io.IOException;
import javax.servlet.http.*;

public class TestServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
        resp.sendRedirect("http://www.google.com/");
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top