I have a CDI application using Deltaspike which uses the incredibly useful @WindowScoped
annotation to support multiple tabs. The scenario of the application is as follows:
- User selects an item from a list and clicks 'Edit'.
- The user authenticates against object.
- The id of the object being edited and the username of the authenticated user is stored against the window scope and is available to all the pages within the edit section of the system.
- When the user has finished accessing this object they click finish and their session with this object is closed (
@WindowScoped
bean wiped out).
If the user opens a new tab and then selects a new object to edit then everything works perfectly, since the ID and authentication details are stored against a new @WindowScoped
object.
However, since there are multiple edit pages the user is also able to right click and open the link in a new tab. This then fails because the new @WindowScoped
bean doesn't know anything about the context in which it was created (basically the object ID and username of the previous session).
Is there a way using @WindowScoped
to access the previous window scoped object? Or is there a common way to share information between window scoped beans?
Thanks for any advice!