code: public void refreshRequestViewContext(FacesContext facesContext, UIViewRoot root)
      {
          for (Map.Entry<String, UIComponent> entry : root.getFacets().entrySet())
          {
              UIComponent facet = entry.getValue();
              if (facet.getId() != null && facet.getId().startsWith("javax_faces_location_"))
              {
                  try
                  {
                      facesContext.getAttributes().put(SKIP_ITERATION_HINT, Boolean.TRUE);
  
                      VisitContext visitContext = VisitContext.createVisitContext(facesContext, null, VISIT_HINTS);
                      facet.visitTree(visitContext, new RefreshViewContext());
                  }
                  finally
                  {
                      // We must remove hint in finally, because an exception can break this phase,
                      // but lifecycle can continue, if custom exception handler swallows the exception
                      facesContext.getAttributes().remove(SKIP_ITERATION_HINT);
                  }
              }
          }
      }
docs: Scans UIViewRoot facets with added component resources by the effect of
  @ResourceDependency annotation, and register the associated inspected classes
  so new component resources will not be added to the component tree again and again.
  
  @param facesContext
  @param root