docs: public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
              ELException
      {
          UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
          if (root != null)
          {
              if (this.locale != null)
              {
                  root.setLocale(ComponentSupport.getLocale(ctx, this.locale));
              }
              if (this.renderKitId != null)
              {
                  String v = this.renderKitId.getValue(ctx);
                  root.setRenderKitId(v);
              }
              String encodingValue = null;
              if (this.contentType != null)
              {
                  // This value is read as rfc2616 section 3.7 Media Types.
                  // We should check and extract the param "charset" and assing
                  // it as encoding for this page.
                  String v = this.contentType.getValue(ctx);
                  if (v != null)
                  {
                      int j = v.indexOf(';');
                      if (j >= 0)
                      {
                          int i = v.indexOf("charset",j);
                          if (i >= 0)
                          {
                              i = v.indexOf('=',i)+1;
                              if (v.length() > i)
                              {
                                  encodingValue = v.substring(i);
                              }
                              // Substract charset from encoding, it will be added 
                              // later on FaceletViewDeclarationLanguage.createResponseWriter
                              // by calling response.setContentType
                              v = v.substring(0 , j);
                          }
                      }
                  }
                  ctx.getFacesContext().getAttributes().put("facelets.ContentType", v);
              }
              if (this.encoding != null)
              {
                  String v = this.encoding.getValue(ctx);
                  ctx.getFacesContext().getAttributes().put("facelets.Encoding", v);
              }
              else if (encodingValue != null)
              {
                  ctx.getFacesContext().getAttributes().put("facelets.Encoding", encodingValue);
              }
              if (this.beforePhase != null)
              {
                  MethodExpression m = this.beforePhase.getMethodExpression(ctx, null, LISTENER_SIG);
                  root.setBeforePhaseListener(m);
              }
              if (this.afterPhase != null)
              {
                  MethodExpression m = this.afterPhase.getMethodExpression(ctx, null, LISTENER_SIG);
                  root.setAfterPhaseListener(m);
              }
              if (this.transientAttribute != null)
              {
                  root.setTransient(this.transientAttribute.getBoolean(ctx));
              }
              if (this.contracts != null)
              {
                  String contractsValue = this.contracts.getValue(ctx);
                  if (contractsValue != null)
                  {
                      String[] values = StringUtils.trim(
                          StringUtils.splitShortString(contractsValue, ','));
                      if (values != null)
                      {
                          List<String> list = new ArrayList<String>();
                          for (String v : values)
                          {
                              list.add(v);
                          }
                          ctx.getFacesContext().setResourceLibraryContracts(list);
                      }
                  }
              }
              if (this.oamEnableViewPool != null)
              {
                  root.getAttributes().put("oamEnableViewPool", this.oamEnableViewPool.getBoolean(ctx));
              }
          }
          this.nextHandler.apply(ctx, parent);
      }