Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
10. Jun 2008, 10:30 CET | Link

I'm not sure this has anything specifically to do with Seam, but I'm hoping there might be a neat way of accomplishing this with Seam.

What I'm interested in doing is sharing session-scoped information between multiple clients/browsers logged in as the same user.

An example of what I would like to accomplish:

- User A logs in using Firefox. - User A executes an order in the system, which is stored in a session scoped bean. - User A opens Internet Explorer and (once again) logs in to the system (since IE has no idea that there is a valid session in Firefox). - User A lists his current orders in IE, and should see the order he just executed using Firefox. - User A cancels the order in IE. - User A switches back to Firefox, lists his orders, and the order should be cancelled.

Is there any way of accomplishing this without persisting the order information immediately?

3 Replies:
10. Jun 2008, 10:45 CET | Link

I don't think there is any natural way of doing that(?) but you could always use the application scope to store stuff e.g. in a Map with the user id as key...

 

If a man speaks in the forest and there is no woman around to hear him, is he still wrong?

10. Jun 2008, 11:00 CET | Link

That is of course an acceptable solution if there was only one or a few specific usecases. I guess the issue is that we would like our application to have this behaviour for all session-scoped data. It should just work.

In essence, a new scope type USER or IDENTITY would be ideal. I'm thinking of formulating a request for such a feature.

But in the meantime, perhaps there is someway of tricking the application or server into using the same HttpSession for both clients/browsers as long as the same identity is established?

10. Jun 2008, 11:45 CET | Link

Perhaps you could extend BasicContext and override stuff from Context to take the identity in account.

But yes, I see the usecase for custom scopes like that, haven't looked if there are JIRAs for it.

 

If a man speaks in the forest and there is no woman around to hear him, is he still wrong?