if (hopres.realm != null) { res.setHeader("WWW-Authenticate", "Basic realm=\"" + hopres.realm + "\"");
if (hopres.getRealm() != null) { res.setHeader("WWW-Authenticate", "Basic realm=\"" + hopres.getRealm() + "\"");
    void writeResponse(HttpServletRequest req, HttpServletResponse res,                       ResponseTrans hopres) throws IOException {        if (hopres.getForward() != null) {            sendForward(res, hopres);            return;        }        if (hopres.getETag() != null) {            res.setHeader("ETag", hopres.getETag());        }        if (hopres.getRedirect() != null) {            sendRedirect(req, res, hopres.getRedirect());        } else if (hopres.getNotModified()) {            res.setStatus(HttpServletResponse.SC_NOT_MODIFIED);        } else {            if (!hopres.cache || !caching) {                // Disable caching of response.                // for HTTP 1.0                res.setDateHeader("Expires", System.currentTimeMillis() - 10000);                res.setHeader("Pragma", "no-cache");                // for HTTP 1.1                res.setHeader("Cache-Control",                              "no-cache, no-store, must-revalidate, max-age=0");            }            if (hopres.realm != null) {                res.setHeader("WWW-Authenticate", "Basic realm=\"" + hopres.realm + "\"");            }            if (hopres.status > 0) {                res.setStatus(hopres.status);            }            // set last-modified header to now            long modified = hopres.getLastModified();            if (modified > -1) {                res.setDateHeader("Last-Modified", System.currentTimeMillis());            }            res.setContentLength(hopres.getContentLength());            res.setContentType(hopres.getContentType());            if ("HEAD".equalsIgnoreCase(req.getMethod())) {                return;            }            try {                OutputStream out = res.getOutputStream();                out.write(hopres.getContent());                out.flush();            } catch (Exception io_e) {                log("Exception in writeResponse: " + io_e);            }        }    }