In ViewMetadata.createMetadataView(), specify
- the new UIViewRoot must be set as the FacesContext's viewRoot before applying the tag handlers, restoring
the old FacesContext in a finally block.
- The content's of the current UIViewRoot's ViewMap must be copied to the ViewMap of the new UIViewRoot
before applying the tag handlers.