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