On 7/8/05, Werner Punz <[EMAIL PROTECTED]> wrote:
>
> But one of the biggest gaps of the current JSF specs is that you do not
> have local scopes... scopes which are bigger than a request but smaller
> than a session. Shale has something with the dialog system, which I have
> not checked out yet.
>
UIltimately, a standardized solution to this problem really belongs in
the servlet spec so that the entire web tier can use it. In the mean
time, Shale's approach works like this:
* You have a "Status" bean that the framework uses to
keep track of navigating through a particular dialog.
Among other things, it knows how to do nested dialogs.
* This bean has a "data" property of type Object, so the
application can push any sort of bean it wants, to save
and restore state for that particular dialog.
* As a new dialog is entered, the current data object is
pushed onto a stack so that the new dialog can push
on its own data object.
* When a dialog is exited, the stack is popped, making
the data object from the previous dialog is made visible
again, and the state for the just-completed dialog is
released for garbage collection.
>From a JSF perspective, this approach has the additional advantage
that a value binding expression to access the state information stays
the same ("#{status.data.foo}") no matter how deep the stack of nested
dialogs is -- the data for the currently executing dialog is always
the state that is visible to the expression.
Craig