code: public UIForm locateForm() {
          UIComponent parent = this.getParent();
          while (!(parent instanceof UIForm)) {
              if ((parent == null) || (parent instanceof UIViewRoot)) {
                  throw new IllegalStateException(
                          "The UIValidateForm (<s:validateForm />) component must be placed within a UIForm (<h:form>)");
              }
              parent = parent.getParent();
          }
          return (UIForm) parent;
      }
docs: Attempt to locate the form in which this component resides. If the component is not within a UIForm tag, throw an
  exception.