如何在有状态 Web 应用程序中最好地连接 Seam 和 GWT?
我们有一个使用 GWT 实现的 Web 应用程序。 它所呈现的内容是使用远程处理机制从 Jboss/Seam 服务器获取的,并且效果很好。 但是,该应用程序现在已扩展为支持会话和用户。 Seam GWT 服务似乎没有提供一种让我登录的方法,以便 Seam 可以将受限数据返回到 GWT 应用程序,因此在我看来,我必须将 GWT 应用程序包装在 Facelet 中。
然而,使用 Seam 会话机制登录将帮助我将正确的数据输入 GWT 应用程序对我来说并不明显,所以我的问题是我是否会幸运并且它会正常工作,或者我是否需要做一些客户端操作魔法、服务器端魔法或者我对 Seam GWT 服务中缺少登录功能的看法实际上是错误的。
奖励积分给任何可以为我提供显示类似内容的完整示例的人。
We have a web application that was implemented using GWT. What it presents is fetched from a Jboss/Seam server using the remoting mechanism, and this works fine. However, the application is now extended to support sessions and users. The Seam GWT service doesn't seem to provide a way to let me log in such that Seam can return restricted data back to the GWT application, and so it looks to me that I will have to wrap the GWT application in facelets.
It is not obvious to me that a login using the Seam session mechanism will help me get correct data into the GWT application however, so my question is whether I will be lucky and it will just work, or if I need to do some client side magic, server side magic or if my perception of missing login functionality in the Seam GWT service actually is wrong.
Bonus points to anyone that can provide me with a complete example showing something similar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,事情正如我所希望的那样“正常运转”。 通过使用 Seam 的身份和登录机制,我可以通过从应用程序的 GWT 部分获取请求的服务代码中的
Identity.instance().getUsername();
访问当前登录的用户。我尝试在服务上添加
@Restrict
注释,但这似乎不起作用,但是只要我可以基于以下内容向 GWT 应用程序提供结果,就不需要这样做:已登录的用户。It turns out that things are "just working" as I hoped. By using Seam's Identity and login mechanism, I can access the current logged in user via
Identity.instance().getUsername();
in the service code that gets requests from the GWT portion of the application.I tried to put a
@Restrict
annotation on the service, but this did not appear to work, however this is not something that is not needed as long as I can provide results to the GWT application based on the logged in user.google code 上的这个完整的 GWT 应用程序怎么样 - http://code.google.com/ p/tocollege-net/ ?
How about this complete GWT app on google code -- http://code.google.com/p/tocollege-net/ ?