• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / displaytag / 1753

12 Feb 2026 03:17AM UTC coverage: 77.321% (-0.01%) from 77.334%
1753

push

github

web-flow
Merge pull request #1102 from hazendaz/renovate/javax-support-logback-monorepo

Update dependency ch.qos.logback:logback-classic to v1.5.29 (javax-support)

1438 of 2003 branches covered (71.79%)

Branch coverage included in aggregate %.

4034 of 5074 relevant lines covered (79.5%)

0.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.71
/displaytag/src/main/java/org/displaytag/tags/TableFooterTag.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2002-2026 Fabrizio Giustina, the Displaytag team
6
 */
7
package org.displaytag.tags;
8

9
import java.util.List;
10
import java.util.Map;
11

12
import javax.servlet.jsp.JspException;
13
import javax.servlet.jsp.tagext.BodyTagSupport;
14
import javax.servlet.jsp.tagext.Tag;
15
import javax.servlet.jsp.tagext.TagSupport;
16

17
import org.displaytag.exception.TagStructureException;
18
import org.displaytag.properties.MediaTypeEnum;
19
import org.displaytag.util.MediaUtil;
20

21
/**
22
 * Display a table footer. Html only, not included in export.
23
 */
24
public class TableFooterTag extends BodyTagSupport implements MediaUtil.SupportsMedia {
1✔
25

26
    /**
27
     * Serial ID.
28
     */
29
    private static final long serialVersionUID = 899149338534L;
30

31
    /**
32
     * The media supported attribute.
33
     */
34
    private transient List<MediaTypeEnum> supportedMedia;
35

36
    /**
37
     * Do end tag.
38
     *
39
     * @return the int
40
     *
41
     * @throws JspException
42
     *             the jsp exception
43
     *
44
     * @see javax.servlet.jsp.tagext.Tag#doEndTag()
45
     */
46
    @Override
47
    public int doEndTag() throws JspException {
48
        final TableTag tableTag = (TableTag) TagSupport.findAncestorWithClass(this, TableTag.class);
1✔
49

50
        if (tableTag == null) {
1!
51
            throw new TagStructureException(this.getClass(), "footer", "table");
×
52
        }
53

54
        final MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext
1✔
55
                .findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
1✔
56
        if (currentMediaType != null && !MediaUtil.availableForMedia(this, currentMediaType)) {
1!
57
            return Tag.SKIP_BODY;
×
58
        }
59

60
        if (tableTag.isLastIteration() && this.getBodyContent() != null) {
1!
61
            tableTag.setFooter(this.getBodyContent().getString());
1✔
62
        }
63

64
        return Tag.EVAL_PAGE;
1✔
65
    }
66

67
    /**
68
     * Do start tag.
69
     *
70
     * @return the int
71
     *
72
     * @throws JspException
73
     *             the jsp exception
74
     *
75
     * @see javax.servlet.jsp.tagext.Tag#doStartTag()
76
     */
77
    @Override
78
    public int doStartTag() throws JspException {
79
        final TableTag tableTag = (TableTag) TagSupport.findAncestorWithClass(this, TableTag.class);
1✔
80

81
        if (tableTag == null) {
1!
82
            throw new TagStructureException(this.getClass(), "footer", "table");
×
83
        }
84

85
        final MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext
1✔
86
                .findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
1✔
87
        if (!MediaUtil.availableForMedia(this, currentMediaType)) {
1!
88
            return Tag.SKIP_BODY;
×
89
        }
90

91
        // Run the footer only when all of the cells have been populated
92
        if (tableTag.isLastIteration()) {
1✔
93
            if (tableTag.getVarTotals() != null) {
1!
94
                final Map<String, Double> totals = tableTag.getTotals();
×
95
                this.pageContext.setAttribute(tableTag.getVarTotals(), totals);
×
96
            }
97
            // using int to avoid deprecation error in compilation using j2ee 1.3 (EVAL_BODY_TAG)
98
            return 2;
1✔
99
        }
100

101
        return Tag.SKIP_BODY;
1✔
102
    }
103

104
    /**
105
     * Sets the supported media.
106
     *
107
     * @param media
108
     *            the new supported media
109
     *
110
     * @see org.displaytag.util.MediaUtil.SupportsMedia#setSupportedMedia(java.util.List)
111
     */
112
    @Override
113
    public void setSupportedMedia(final List<MediaTypeEnum> media) {
114
        this.supportedMedia = media;
×
115
    }
×
116

117
    /**
118
     * Gets the supported media.
119
     *
120
     * @return the supported media
121
     *
122
     * @see org.displaytag.util.MediaUtil.SupportsMedia#getSupportedMedia()
123
     */
124
    @Override
125
    public List<MediaTypeEnum> getSupportedMedia() {
126
        return this.supportedMedia;
1✔
127
    }
128

129
    /**
130
     * Tag setter.
131
     *
132
     * @param media
133
     *            the space delimited list of supported types
134
     */
135
    public void setMedia(final String media) {
136
        MediaUtil.setMedia(this, media);
×
137
    }
×
138

139
    /**
140
     * Release.
141
     *
142
     * @see javax.servlet.jsp.tagext.Tag#release()
143
     */
144
    @Override
145
    public void release() {
146
        this.supportedMedia = null;
1✔
147
        super.release();
1✔
148
    }
1✔
149

150
    /**
151
     * Tag setter.
152
     *
153
     * @param showAsLastRow
154
     *            the space delimited list of supported types
155
     */
156
    public void setShowAsLastRow(final boolean showAsLastRow) {
157
    }
×
158
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc