如何实现GWT回调url? [英] How can I implement a GWT callback url?

查看:138
本文介绍了如何实现GWT回调url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个要使用OAuth的GWT应用程序。 OAuth提供了通过您传递到网站的网址以及作为网址参数一部分的访问密钥回调您的网站的功能。

I'm writing a GWT application that's going to use OAuth. OAuth provides the ability to 'callback' to your website via a url that you pass into it along with an access key as part of the url parameters.

我的问题是:对于GWT应用程序,如何允许将自定义网址粘贴/重定向到地址栏?基本上它将是一个服务器请求,这是一个简单的使用tomcat服务器与jsp,但有一个方法来处理这个使用纯GWT实现?

My question is this: For a GWT application, how can I allow a custom URL to be pasted / redirected into the address bar? Essentially it will be a server request which is dead simple using a tomcat server with jsp, but is there a way to handle this using a pure GWT implementation?

我可以想象以下是可能的:

I can imagine the following is posible:


  • 编写与GWT项目一起部署的jsp页面

  • 访问密钥

  • 将用户重新定向到我的GWT应用程序的主页

有一个更纯的方式来做到这一点与GWT?我可以直接调用RPC服务来做这个任务吗?如果我调用RPC服务,我应该将用户重定向到主页面?我可以实现我的GWT客户端代码,以便它识别从URL传递的自定义参数?

Is there a more pure way to do this with GWT? Can I call directly into the RPC service to do this task? If I call into the RPC service, am I supposed to redirect the user to a main page? Can I just implement my GWT client side code so it recognizes custom parameters passed from the url?

你认为这是最好的方法是什么?

What do you think is the best approach for this?

推荐答案

请参阅com.google.gwt.user.client.Window.Location.replace(String newUrl),但是坏消息是,所有内部历史。以下是一个人的 OAuth及其纯GWT解决方案的博客条目。此外,还有一个 GWT示例项目,可以执行OAuth

See com.google.gwt.user.client.Window.Location.replace(String newUrl), however the bad news is that you will lose all internal history. Here is a blog entry of one person's experiences with OAuth and his pure GWT solution. Also there is a GWT example project that does OAuth.

这篇关于如何实现GWT回调url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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