docs: public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
              ELException
      {
          VariableMapper orig = ctx.getVariableMapper();
          AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
          actx.pushClient(this);
  
          if (_params != null)
          {
              VariableMapper vm = new VariableMapperWrapper(orig);
              ctx.setVariableMapper(vm);
              for (int i = 0; i < _params.length; i++)
              {
                  _params[i].apply(ctx, parent);
              }
          }
  
          FaceletCompositionContext fcc = FaceletCompositionContext.getCurrentInstance(ctx);
          String path;
          boolean markInitialState = false;
          if (!_template.isLiteral())
          {
              String uniqueId = actx.generateUniqueFaceletTagId(fcc.startComponentUniqueIdSection(), tagId);
              //path = getTemplateValue(actx, fcc, parent, uniqueId);
              String restoredPath = (String) ComponentSupport.restoreInitialTagState(ctx, fcc, parent, uniqueId);
              if (restoredPath != null)
              {
                  // If is not restore view phase, the path value should be
                  // evaluated and if is not equals, trigger markInitialState stuff.
                  if (!PhaseId.RESTORE_VIEW.equals(ctx.getFacesContext().getCurrentPhaseId()))
                  {
                      path = this._template.getValue(ctx);
                      if (path == null || path.length() == 0)
                      {
                          return;
                      }
                      if (!path.equals(restoredPath))
                      {
                          markInitialState = true;
                      }
                  }
                  else
                  {
                      path = restoredPath;
                  }
              }
              else
              {
                  //No state restored, calculate path
                  path = this._template.getValue(ctx);
              }
              ComponentSupport.saveInitialTagState(ctx, fcc, parent, uniqueId, path);
          }
          else
          {
              path = _template.getValue(ctx);
          }
          try
          {
              try
              {
                  boolean oldMarkInitialState = false;
                  Boolean isBuildingInitialState = null;
                  if (markInitialState)
                  {
                      //set markInitialState flag
                      oldMarkInitialState = fcc.isMarkInitialState();
                      fcc.setMarkInitialState(true);
                      isBuildingInitialState = (Boolean) ctx.getFacesContext().getAttributes().put(
                              StateManager.IS_BUILDING_INITIAL_STATE, Boolean.TRUE);
                  }
                  try
                  {
                      ctx.includeFacelet(parent, path);
                  }
                  finally
                  {
                      if (markInitialState)
                      {
                          //unset markInitialState flag
                          if (isBuildingInitialState == null)
                          {
                              ctx.getFacesContext().getAttributes().remove(
                                      StateManager.IS_BUILDING_INITIAL_STATE);
                          }
                          else
                          {
                              ctx.getFacesContext().getAttributes().put(
                                      StateManager.IS_BUILDING_INITIAL_STATE, isBuildingInitialState);
                          }
                          fcc.setMarkInitialState(oldMarkInitialState);
                      }
                  }
              }
              finally
              {
                  ctx.setVariableMapper(orig);
                  actx.popClient(this);
              }
          }
          finally
          {
              if (!_template.isLiteral())
              {
                  fcc.endComponentUniqueIdSection();
              }
          }
          if (!_template.isLiteral() && fcc.isUsingPSSOnThisView() && fcc.isRefreshTransientBuildOnPSS() &&
              !fcc.isRefreshingTransientBuild())
          {
              //Mark the parent component to be saved and restored fully.
              ComponentSupport.markComponentToRestoreFully(ctx.getFacesContext(), parent);
          }
          if (!_template.isLiteral() && fcc.isDynamicComponentSection())
          {
              ComponentSupport.markComponentToRefreshDynamically(ctx.getFacesContext(), parent);
          }
      }