The WindowScopeManager needs to exists from the beginning in the session, creating and setting it up only when needed is not possible because the manager needs to keep track of the opened and closed windows all the time. It can be imagined a scenario where the first loaded page does not have a window scope bean, after forward navigating to the next page this will have a window scope bean. The window hasn't changed in the mean while just the rendered view, hence the continuous need for WindowScopeManager.
Actually the scenario described above was implemented as a test which confirmed the conceptual analysis.
The WindowScopeManager needs to exists from the beginning in the session, creating and setting it up only when needed is not possible because the manager needs to keep track of the opened and closed windows all the time. It can be imagined a scenario where the first loaded page does not have a window scope bean, after forward navigating to the next page this will have a window scope bean. The window hasn't changed in the mean while just the rendered view, hence the continuous need for WindowScopeManager.
Actually the scenario described above was implemented as a test which confirmed the conceptual analysis.