@Override
    public int doEndTag() throws JspTagException {
        try {
            JspWriter out = pageContext.getOut();
            if (pageNo != 0) {
                out.write("<thead><tr><th scope='col'>");
                for (int i = 1; i <= pages; i++) {
                    if (i != pageNo) {
                        out.write("<a class='small labelH' href='controller?command=showpage&currPageNo=" + i + "'>" + i + "</a>");
                    } else {
                        out.write("<a class='small labelH'>" + pageNo + "</a>");
                    }
                }
                out.write("</th></tr></thead>");
            }
            out.write("</td></tr></tbody></table>");
        } catch (IOException e) {
            throw new JspTagException(e.getMessage());
        }
        return EVAL_PAGE;
    }