Tim Holloway wrote:Session scope and View scope are 2 distinct things. JSF Session scope is the same thing as J2EE session scope - an object is constructed and it is stored in the HttpSession's object map. The only difference between JSF and raw J2EE is that JSF can do the construction and storage for you automatically (Managed Beans).
There is no J2EE/JEE equivalent to View scope, since Views are an abstraction not supported directly by J2EE primitives. In actuality, View Scope is just Session Scope with the refinement that when JSF navigates to a new View, the view-scope object(s) of the old view are removed from scope. NOT deleted, mind you - if there are hanging references directly to those objects, the objects will remain (not be garbage-collected) - but no longer referenced from the HttpSession.
I cannot guarantee what would happen to view-scope objects if, instead of using JSF navigation or link tags you did a raw URL jump to a new page. If the new page wasn't a JSF page, then I'd expect the view-scope object(s) to remain attached to the HttpSession, If the new page was a JSF page, maybe the new view initialization code would detect and remove them, maybe not. I haven't read that part of the spec to see if it mandates a particular behavior.
All I can say is that if you rely on perceived behavior on session and view scope objects rather than on spec-defined behavior, you'll probably regret it sooner or later.
Tim Holloway wrote:Since Tomcat doesn't support JSF at all, I have no clue.
JSF under Tomcat is entirely handled by JSF libraries in the webapp - unlike full-stack JEE servers - Tomcat has no JSF functionality of its own.