Help

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.

There is an important distinction between the page scope and the temporary conversation. The conversation ensures that variables set at the beginning of the request survive any redirect that occurs prior to the page being rendered. You can think of it as a request scope from the perspective of the user (the user only made one request). The page scope, on the other hand, is bound to the view, as a mentioned above. So this is going to stick around for as long as the user is posting back to the same page using JSF postbacks (activing UICommand components for instance). A redirect is essentially a new initial request (non-postback) so the page scope is dropped (remember, it isn't destroyed until the view is discarded).

I strongly recommend that you use conversation scope rather than page scope for your stateful components. That's because there is another major limitation of the page scope, aside from the fact that it is basically unmanaged and can lead to memory leaks (assuming requests are coming in faster than sessions are expiring) is that entities become detached if you don't have a long-running conversation. You really don't want to be in the business of merging because once you start down that path, it is a slippery slow. It is prudent to determine where the boundaries of your conversation are and put the proper controls in place to hit those boundaries. I will agree that it takes some effort to get setup, but in the end you are going to be much better off and your application will be better designed.