如何在有状态的Web应用程序中最好地连接Seam和GWT?

时间:2021-09-28 16:05:22

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.

我们有一个使用GWT实现的Web应用程序。它呈现的是使用远程处理机制从Jboss / Seam服务器获取的,这很好用。但是,该应用程序现在已扩展为支持会话和用户。 Seam GWT服务似乎没有提供让我登录的方法,以便Seam可以将受限数据返回给GWT应用程序,因此我认为我必须将GWT应用程序包装在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.

对我来说,使用Seam会话机制的登录将帮助我将正确的数据输入GWT应用程序并不是很明显,所以我的问题是我是否会幸运,它是否会起作用,或者我是否需要做一些客户端魔术,服务器端魔术或者我对Seam GWT服务中缺少登录功能的看法实际上是错误的。

Bonus points to anyone that can provide me with a complete example showing something similar.

奖励指向任何能够为我提供完整示例的人。

2 个解决方案

#1


3  

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.

事实证明,事情正如我所希望的那样“正常工作”。通过使用Seam的身份和登录机制,我可以通过Identity.instance()访问当前登录的用户.getUsername();在从服务器的GWT部分获取请求的服务代码中。

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.

我试图在服务上放置@Restrict注释,但这似乎不起作用,但只要我可以根据登录用户向GWT应用程序提供结果,这不是不需要的。

#2


-1  

How about this complete GWT app on google code -- http://code.google.com/p/tocollege-net/ ?

谷歌代码上这个完整的GWT应用程序怎么样 - http://code.google.com/p/tocollege-net/?

#1


3  

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.

事实证明,事情正如我所希望的那样“正常工作”。通过使用Seam的身份和登录机制,我可以通过Identity.instance()访问当前登录的用户.getUsername();在从服务器的GWT部分获取请求的服务代码中。

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.

我试图在服务上放置@Restrict注释,但这似乎不起作用,但只要我可以根据登录用户向GWT应用程序提供结果,这不是不需要的。

#2


-1  

How about this complete GWT app on google code -- http://code.google.com/p/tocollege-net/ ?

谷歌代码上这个完整的GWT应用程序怎么样 - http://code.google.com/p/tocollege-net/?