s.append(" <p id=\"detail\">\n"); if (result.getStatusCode() != 200) { s.append ("Status code ").append(result.getStatusCode());
@Override protected ResponseStreams finalizeHeaders(Result result, Boolean handleFlashAndSessionCookie) { // delegate cookie, session, and flash to parent super.finalizeHeaders(result, handleFlashAndSessionCookie); httpServletResponse.setStatus(result.getStatusCode()); // copy headers for (Entry<String, String> header : result.getHeaders().entrySet()) { httpServletResponse.addHeader(header.getKey(), header.getValue()); } // set content type if (result.getContentType() != null) { httpServletResponse.setContentType(result.getContentType()); } // Set charset => use utf-8 if not set // Sets correct encoding for Content-Type. But also for the output // writers. if (result.getCharset() != null) { httpServletResponse.setCharacterEncoding(result.getCharset()); } else { httpServletResponse.setCharacterEncoding(NinjaConstant.UTF_8); } // possibly ResponseStreamsServlet responseStreamsServlet = new ResponseStreamsServlet(); responseStreamsServlet.init(httpServletResponse); return responseStreamsServlet; }
appendNameValue(s, "Charset", result.getCharset()); appendNameValue(s, "Content type", result.getContentType()); appendNameValue(s, "Status code", result.getStatusCode()+"");
httpCacheToolkit.addEtag(context, result, lastModified); if (result.getStatusCode() == Result.SC_304_NOT_MODIFIED) {
exchange.setStatusCode(result.getStatusCode());