@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
    assert master != null : "No Master in context!";

    response.setContentType("text/html");

    Configuration conf = master.getConfiguration();

    Map<String, Integer> frags = getFragmentationInfo(master, conf);
    ServerName metaLocation = null;
    List<ServerName> servers = null;
    Set<ServerName> deadServers = null;

    if (master.isActiveMaster()) {
      metaLocation = getMetaLocationOrNull(master);
      ServerManager serverManager = master.getServerManager();
      if (serverManager != null) {
        deadServers = serverManager.getDeadServers().copyServerNames();
        servers = serverManager.getOnlineServersList();
      }
    }

    MasterStatusTmpl tmpl =
      new MasterStatusTmpl().setFrags(frags).setMetaLocation(metaLocation).setServers(servers)
        .setDeadServers(deadServers).setCatalogJanitorEnabled(master.isCatalogJanitorEnabled());

    if (request.getParameter("filter") != null) tmpl.setFilter(request.getParameter("filter"));
    if (request.getParameter("format") != null) tmpl.setFormat(request.getParameter("format"));
    tmpl.render(response.getWriter(), master);
  }
The servlet responsible for rendering the index page of the master.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/MasterStatusServlet.java