コード例 #1
0
ファイル: SalesRepListTag.java プロジェクト: sorinoi/laconic
 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());
     }
   }
 }
コード例 #2
0
ファイル: SalesRepListTag.java プロジェクト: sorinoi/laconic
  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());
  }