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.
| Online: | 26 Members of 4510 |
| Forum: Seam Users |
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?
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?
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 .
In essence, a new scope type or 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?
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?