System.out.println("submit=" + submit);
    private void viewManyAgents() throws IOException {      response.setContentType("text/html");      out = response.getWriter();      format = FORMAT_HTML;     // Force html format      SortedSet selectedAgents = new TreeSet(getSelectedAgents());      boolean selectAll = false;      boolean selectNone = false;      String submit = request.getParameter("submit");      System.out.println("submit=" + submit);      if ("Show".equals(submit)) {        viewSelectedAgents(new ArrayList(selectedAgents), "Selected");        return;      }      if ("Select All".equals(submit)) {        selectAll = true;      } else if ("Select None".equals(submit)) {        selectNone = true;      }      List l = getAllAgentNames();      Collections.sort(l);      String title ="Select Agents for Completion Display";      out.println(          "<html>\n" +          "<head>\n" +          "<title>"+          getTitlePrefix()+          title+"</title>\n" +          "</head>");      out.println(          "<body>\n"+          "<h2><center>"+title+"</h2></center>");      out.println("<form action=\"/$"+          getEncodedAgentName()+getPath()+          "\" target=\"_top\">");      out.println("<input type=\"submit\" name=\"submit\" value=\"Select All\">");      out.println("<input type=\"submit\" name=\"submit\" value=\"Select None\">");      out.println("<input type=\"submit\" name=\"submit\" value=\"Show\">");      out.println("<input type=\"hidden\" name=\"viewType\" value=\"viewManyAgents\">");      out.println("<table><tr>");      int nagents = l.size();      int agent0 = 0;      int NCOL = 4;      for (int col = 0; col < NCOL; col++) {        out.println("<td valign=\"top\">");        int agent1 = ((col + 1) * nagents + NCOL - 1) / NCOL;        for (; agent0 < agent1; agent0++) {          String agentName = (String) l.get(agent0);          String selected;          if (selectAll || (!selectNone && selectedAgents.contains(agentName))) {            selected = " checked=\"true\"";          } else {            selected = "";          }          out.println("<input type=\"checkbox\" name=\"selectedAgents\" value=\""                      + agentName                      + "\""                      + selected                      + ">"                      + agentName                      + "</input><br>");        }        out.println("</td>");        agent0 = agent1;      }      out.println("</tr></table>");      out.println("</form>");      out.println("</body>");      out.println("</html>");    }