public int doStartTag() throws JspException {
TableTag tableTag = (TableTag) findAncestorWithClass(this, TableTag.class);
if (tableTag == null)
{
throw new TagStructureException(getClass(), "footer", "table");
}
MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
if (!MediaUtil.availableForMedia(this, currentMediaType))
{
return SKIP_BODY;
}
// Run the footer only when all of the cells have been populated
if (tableTag.isLastIteration())
{
if (tableTag.getVarTotals() != null)
{
Map totals = tableTag.getTotals();
this.pageContext.setAttribute(tableTag.getVarTotals(), totals);
}
// using int to avoid deprecation error in compilation using j2ee 1.3 (EVAL_BODY_TAG)
return 2;
}
return SKIP_BODY;
}
|