@Override
    public int doStartTag() throws JspTagException {
        if (pages <= 0) {
            return SKIP_BODY;
        }

        try {
            JspWriter out = pageContext.getOut();
            out.write("<table class='parameterRowB' border='1'><colgroup span='2' title='title' />");
            if (head != null && !head.isEmpty()) {
                out.write("<thead><tr><th scope='col'>" + head + "</th></tr></thead>");
            }
            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("<tbody><tr><td>");
        } catch (IOException e) {
            throw new JspTagException(e.getMessage());
        }
        return EVAL_BODY_INCLUDE;
    }