FacesContext facesContext = FacesContext.getCurrentInstance();
ViewScopeProviderFactory factory = ViewScopeProviderFactory.getViewScopeHandlerFactory(
facesContext.getExternalContext());
ViewScopeProvider handler = factory.getViewScopeHandler(facesContext.getExternalContext());
if (_viewScopeId == null)
{
_viewScopeId = handler.generateViewScopeId(facesContext);
_delegate = handler.createViewScopeMap(facesContext, _viewScopeId);
}
else
{
_delegate = handler.restoreViewScopeMap(facesContext, _viewScopeId);
}
}
return _delegate;
}