code: public static <T> T findAncestor(JspTag from, Class<? extends T> clazz) throws JspException {
  		T parent = clazz.cast(SimpleTagSupport.findAncestorWithClass(from, clazz));
  		if(parent==null) throw new LocalizedJspException(accessor, "JspTagUtils.findAncestor.notFound", getClassName(from.getClass()), getClassName(clazz));
  		return parent;
  	}
docs: Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.
  
  @return  the parent tag
  @exception  JspException  if parent not found