Esempio n. 1
0
  /** @see javax.servlet.jsp.tagext.Tag#doStartTag() */
  public int doStartTag() throws JspException {
    TableTag tableTag = getTableTag();
    if (tableTag == null) {
      throw new TagStructureException(getClass(), "column", "table");
    }

    // If the list is empty, do not execute the body; may result in NPE
    if (tableTag.isEmpty() || !tableTag.isIncludedRow()) {
      return SKIP_BODY;
    }

    MediaTypeEnum currentMediaType =
        (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
    if (!MediaUtil.availableForMedia(this, currentMediaType)) {
      return SKIP_BODY;
    }

    return super.doStartTag();
  }