Vaadin从按钮点击重定向到URL [英] Vaadin redirecting to a URL from button click

查看:366
本文介绍了Vaadin从按钮点击重定向到URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了很长时间,但我真的无法解决这个问题。

I have searched for a long time, but I really cannot figure this out.

如何将用户重定向到新的外部链接(例如 www.google.com )当他们点击Vaadin中的按钮时?

How do I redirect the user to a new external link (e.g. www.google.com) when they click a button in Vaadin?

我到目前为止唯一设法做的就是将链接放入链接

The only thing I have managed to do so far is to put the link into a link

Link link = new Link("link", new ExternalResource("http://www.google.com"));

有人可以帮我解决这个问题吗?

Can anyone help me out with this please?

推荐答案

getUI().getPage().setLocation("http://www.google.com");

参考文献:页面(Vaadin 7.2.1 API)Vaadin应用程序生命周期(Vaadin书)

这篇关于Vaadin从按钮点击重定向到URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆