Bieringer, Dominik wrote:

I’ve just read section 2.2.1 as you’ve suggested.

>> Examine the FacesContext instance for the current request. If it already contains a UIViewRoot…

How can the Faces Context contain a UIViewRoot prior to RestoreView phase? Only if I am setting it manually in the BEFORE RestoreView phase… ?


Can you post a little more context for this quote? I don't have the spec handy here..

>> Derive the /view identifier /that corresponds to this request, as follows:

This identifier will be used to restore the correct view, won’t it?


Well, it's used to determine what jsp to execute for views of new pages. However when revisiting a page (ie after performing an action with navigation=null) the component tree already exists, so it is restored from data cached either in the session ("server side state saving") or encoded as a hidden field in the form ("client side state saving"). I expect that if the URL doesn't match the cached data then the cached tree is ignored and a new view is rendered (eg in the case where server-side state is used and a user has visited a page then typed in a raw url to somewhere else in the app).

As I mentioned in an earlier email, for server-side state saving myfaces (and Sun SI) maintain a cache of old component trees.

If prefix mapping (such as “/faces/*”) is used for FacesServlet, the viewId is set from the extra path information of the request URI.

If suffix mapping (such as “*.faces”) is used for FacesServlet, the viewId is set from the servlet path information of the request URI, after replacing the…

So, there is no information about the actual request… That would mean that if you open two browser windows, both working on the same page, that they both get the same component tree ?


For server-side state, if they have the same session cookie then yes I would expect both requests to use the same component tree. Well, actually the component tree is serialized into the http session then deserialized, so the two requests will be working with separate identical copies of the component tree.

However both component trees will be referring to the same managed beans. If the managed beans are request-scoped then that's ok but multiple windows can have unpleasant effects if any session-scoped managed beans are used.

Sorry, but I am bit confused.


It's a confusing topic :-)


Dominik

------------------------------------------------------------------------

*From:* Simon Lessard [mailto:[EMAIL PROTECTED]
*Sent:* Thursday, November 09, 2006 11:42
*To:* MyFaces Discussion
*Subject:* Re: Problem with RESTORE_VIEW

Check the <form> tag in your page, it has an action attribute. And yes the URL is used, dynamic content is always based on the value of some request parameters, they're the source of JSF magic.

For a more detailed description of the phase I suggest you look at the specification found at : http://java.sun.com/javaee/javaserverfaces/download.html near the end of the page (section *JavaServer Faces v1.1 Specification Final Release*). The section fof the specification you want ot read is 2.2.1




Regards,

Simon

Reply via email to