On 12/21/05, Matthias Kahlau <[EMAIL PROTECTED]> wrote:
We might have a terminology issue here. JSF state is related to a particular *view*, not to a *site*. In particular, if you navigate via a GET to the welcome page of a particular site:
http://www.mycompany.com/mysite/
then there *is* no previous state (for the welcome page) to be restored. JSF defines a special behavior in that case ... the Restore View phase says "aha, there is no previous state for me to restore" and proceeds directly to the Render Response phase for this view identifier.
As above, this decision is made on a view-by-view basis, not site-by-site. If you use typical hyperlinks to navigate to a different website, and then back again, you are in the situation described by my previous paragraph ... the return looks like a completely new request, with no state to be restored. The only way there is any state to restore is if you submit back to the view identifier that rendered this view (which is exactly what the standard form component does for you, so you do not have to think about it).
That depends on the ViewHandler implementation you are using. For the default view handler implementation in JSF 1.0/1.1, and if you are using JSP as your view technology, the components are created on the fly as you render a view for the first time. That changes in JSF 1.2 (where all the components are created ahead of time, before the JSP page is actually executed), or if you are using an alternative ViewHandler technology.
CraigHi!
I would like to know when a JSF site can be restored, and when the component
tree of a JSF site has to be recreated. I know that the component tree is
created when a JSF site is shown the first time. I think, a component tree
can always be restored after a postback.
We might have a terminology issue here. JSF state is related to a particular *view*, not to a *site*. In particular, if you navigate via a GET to the welcome page of a particular site:
http://www.mycompany.com/mysite/
then there *is* no previous state (for the welcome page) to be restored. JSF defines a special behavior in that case ... the Restore View phase says "aha, there is no previous state for me to restore" and proceeds directly to the Render Response phase for this view identifier.
But are there other possible constellations when a component tree can be
restored, e. g., is a component tree restored, when the site is shown again,
after another site has been shown?
As above, this decision is made on a view-by-view basis, not site-by-site. If you use typical hyperlinks to navigate to a different website, and then back again, you are in the situation described by my previous paragraph ... the return looks like a completely new request, with no state to be restored. The only way there is any state to restore is if you submit back to the view identifier that rendered this view (which is exactly what the standard form component does for you, so you do not have to think about it).
And just to be sure, does creating the component tree mean that all
components are newly created?
That depends on the ViewHandler implementation you are using. For the default view handler implementation in JSF 1.0/1.1, and if you are using JSP as your view technology, the components are created on the fly as you render a view for the first time. That changes in JSF 1.2 (where all the components are created ahead of time, before the JSP page is actually executed), or if you are using an alternative ViewHandler technology.
Regards,
Matthias

