Codota Logo
TagSupport.findAncestorWithClass
Code IndexAdd Codota to your IDE (free)

How to use
findAncestorWithClass
method
in
javax.servlet.jsp.tagext.TagSupport

Best Java code snippets using javax.servlet.jsp.tagext.TagSupport.findAncestorWithClass (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

if (this.value != null) {
  EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class);
  if (tag == null) {
    throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
origin: org.springframework/spring-webmvc

if (this.value != null) {
  EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class);
  if (tag == null) {
    throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
origin: struts/struts

/**
 * Find parent tag which must implement AttributeContainer.
 * @throws JspException If we can't find an appropriate enclosing tag.
 */
protected PutTagParent findEnclosingPutTagParent() throws JspException {
  try {
    PutTagParent parent =
      (PutTagParent) findAncestorWithClass(this, PutTagParent.class);
    if (parent == null) {
      throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag.");
    }
    return parent;
  } catch (ClassCastException ex) {
    throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag.");
  }
}
origin: struts/struts

/**
 * Find enclosing parent tag accepting this tag.
 * @throws JspException If we can't find an appropriate enclosing tag.
 */
protected PutListTagParent findEnclosingParent() throws JspException {
  try {
    PutListTagParent parent =
      (PutListTagParent) findAncestorWithClass(this,
        PutListTagParent.class);
        
    if (parent == null) {
      throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag.");
    }
    
    return parent;
    
  } catch (ClassCastException ex) {
    throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag.");
  }
}
origin: struts/struts

  /**
   * Find parent tag which must implement AttributeContainer.
   * @throws JspException If we can't find an appropriate enclosing tag.
   */
 protected AddTagParent findEnclosingPutListTagParent() throws JspException {
  try
   {
   AddTagParent parent = (AddTagParent)findAncestorWithClass(this,AddTagParent.class);
   if( parent == null )
    {
    throw new JspException( "Error - tag add : enclosing tag doesn't accept 'add' tag." );
    }
   return parent;
   }
   catch( ClassCastException ex )
   {
   throw new JspException( "Error - tag add : enclosing tag doesn't accept 'add' tag." );
   }
 }
}
origin: org.glassfish.web/jstl-impl

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return null;
  else
    return (xt.getContext());
}

origin: javax.servlet/com.springsource.javax.servlet.jsp.jstl

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return null;
  else
    return (xt.getContext());
}

origin: org.apache.taglibs/com.springsource.org.apache.taglibs.standard

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return null;
  else
    return (xt.getContext());
}

origin: org.eclipse.jetty.orbit/org.apache.taglibs.standard.glassfish

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return null;
  else
    return (xt.getContext());
}

origin: org.bluestemsoftware.open.maven.tparty/jsp-api-2.1

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return null;
  else
    return (xt.getContext());
}

origin: org.jasig.portal/uPortal-web

/**
 * Processes the <CODE>param</CODE> tag.
 *
 * @return <CODE>SKIP_BODY</CODE>
 */
@Override
public int doStartTag() throws JspException {
  final ParameterizableTag parameterizableTag =
      (ParameterizableTag)
          TagSupport.findAncestorWithClass(this, ParameterizableTag.class);
  if (parameterizableTag == null) {
    throw new JspException(
        "the 'param' Tag must have a parent tag that implements ParameterizableTag");
  }
  if (this.name != null) {
    parameterizableTag.addParameter(this.name, this.value);
  }
  return SKIP_BODY;
}
origin: opensymphony/oscache

public int doStartTag() throws JspTagException {
  CacheTag ancestorCacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class);
  if (ancestorCacheTag == null) {
    throw new JspTagException("GroupsTag cannot be used from outside a CacheTag");
  }
  ancestorCacheTag.addGroups(String.valueOf(groups));
  
  return EVAL_BODY_INCLUDE;
}
origin: opensymphony/oscache

public int doStartTag() throws JspTagException {
  CacheTag ancestorCacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class);
  if (ancestorCacheTag == null) {
    throw new JspTagException("GroupTag cannot be used from outside a CacheTag");
  }
  ancestorCacheTag.addGroup(String.valueOf(group));
  return EVAL_BODY_INCLUDE;
}
origin: org.apache.tiles/com.springsource.org.apache.tiles.jsp

  /** {@inheritDoc} */
  @Override
  protected void execute() throws TilesJspException {
    PutAttributeTagParent parent = (PutAttributeTagParent)
      TagSupport.findAncestorWithClass(this, PutAttributeTagParent.class);


    if (parent == null) {
      throw new TilesJspException(
          "Error: no enclosing tag accepts 'putAttribute' tag.");
    }

    parent.processNestedTag(this);
  }
}
origin: org.apache.tiles/com.springsource.org.apache.tiles.jsp

/**
 * Executes the processing of this tag, calling its parent tag.
 *
 * @throws TilesJspException If something goes wrong during execution.
 */
protected void execute() throws TilesJspException {
  AddAttributeTagParent parent = (AddAttributeTagParent)
    TagSupport.findAncestorWithClass(this, AddAttributeTagParent.class);
  if (parent == null) {
    throw new TilesJspException(
        "Error: no enclosing tag accepts 'addAttribute' tag.");
  }
  parent.processNestedTag(this);
}
origin: org.glassfish.web/javax.servlet.jsp.jstl

public static Node getContext(Tag t) throws JspTagException {
  ForEachTag xt =
  (ForEachTag) TagSupport.findAncestorWithClass(
  t, ForEachTag.class);
  if (xt == null)
    return newEmptyDocument();
  else
    return (xt.getContext());
}

origin: org.apache.tiles/com.springsource.org.apache.tiles.jsp

  /** {@inheritDoc} */
  @Override
  protected void execute() throws TilesJspException {
    PutListAttributeTagParent parent = (PutListAttributeTagParent) TagSupport
        .findAncestorWithClass(this, PutListAttributeTagParent.class);

    if (parent == null) {
      // Try with the old method.
      super.execute();
    }

    parent.processNestedTag(this);
  }
}
origin: opensymphony/oscache

  /**
   * The start tag.
   *
   * @throws JspTagException The standard tag exception thrown.
   * @return The standard Tag return.
   */
  public int doStartTag() throws JspTagException {
    CacheTag cacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class);

    if (cacheTag == null) {
      throw new JspTagException("A UseCached tag must be nested within a Cache tag");
    }

    cacheTag.setUseBody(!use);

    return SKIP_BODY;
  }
}
origin: org.dspace/dspace-jspui-api

  public int doAfterBody() throws JspException
  {
    LayoutTag tag = (LayoutTag) TagSupport.findAncestorWithClass(this,
        LayoutTag.class);

    if (tag == null)
    {
      throw new JspException(
          "Sidebar tag must be in an enclosing Layout tag");
    }

    tag.setSidebar(getBodyContent().getString());

    return SKIP_BODY;
  }
}
origin: org.jasig.portal/uPortal-web

@Override
public int doEndTag() throws JspException {
  final RenderPortletTag renderPortletTag =
      (RenderPortletTag) TagSupport.findAncestorWithClass(this, RenderPortletTag.class);
  if (this.windowState != null) {
    final WindowState state = PortletUtils.getWindowState(this.windowState);
    renderPortletTag.setParentUrlState(state);
  }
  if (this.portletMode != null) {
    final PortletMode mode = PortletUtils.getPortletMode(this.portletMode);
    renderPortletTag.setParentUrlMode(mode);
  }
  renderPortletTag.setParentUrlParameters(this.parameters);
  return EVAL_PAGE;
}
javax.servlet.jsp.tagextTagSupportfindAncestorWithClass

Javadoc

Find the instance of a given class type that is closest to a given instance. This method uses the getParent method from the Tag interface. This method is used for coordination among cooperating tags.

The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.

When a tag library author provides information on the observable type of a tag handler, client programmatic code should adhere to that constraint. Specifically, the Class passed to findAncestorWithClass should be a subtype of the observable type.

Popular methods of TagSupport

  • release
    Release state.
  • doEndTag
    Default processing of the end tag returning EVAL_PAGE.
  • doStartTag
    Default processing of the start tag, returning SKIP_BODY.
  • setPageContext
    Set the page context.
  • getValue
    Get a the value associated with a key.
  • setId
    Set the id attribute for this tag.
  • doAfterBody
    Default processing for a body.
  • setValue
    Associate a value with a String key.
  • getId
    The value of the id attribute of this tag; or null.
  • getValues
    Enumerate the keys for the values kept by this tag handler.
  • removeValue
    Remove a value associated with a key.
  • setParent
    Set the nesting tag of this tag.
  • removeValue,
  • setParent,
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now