public int doAfterBody() throws JspException { if (iterator.hasNext()) { setAttribute(); return IterationTag.EVAL_BODY_AGAIN; } else { try { bodyContent.writeOut(bodyContent.getEnclosingWriter()); return SKIP_BODY; } catch (IOException ioe) { throw new JspTagException(ioe.getMessage()); } } }
private void setAttribute() { SalesRep salesRep = (SalesRep) iterator.next(); if (salesRep.equals(currentSalesRep)) { pageContext.setAttribute("selected", "selected"); } else { pageContext.setAttribute("selected", ""); } pageContext.setAttribute("employeeId", salesRep.getEmployeeId()); pageContext.setAttribute("employeeCode", salesRep.getEmployeeCode()); pageContext.setAttribute("employeeName", salesRep.getEmployeeName()); pageContext.setAttribute("titleCode", salesRep.getTitle().getAttributeCode()); pageContext.setAttribute("titleName", salesRep.getTitle().getAttributeName()); pageContext.setAttribute("divisionCode", salesRep.getDivision().getAttributeCode()); pageContext.setAttribute("divisionName", salesRep.getDivision().getAttributeName()); }