public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { AbstractHttpConnection connection = AbstractHttpConnection.getCurrentConnection(); connection.getRequest().setHandled(true); String method = request.getMethod(); if(!method.equals(HttpMethods.GET) && !method.equals(HttpMethods.POST) && !method.equals(HttpMethods.HEAD)) return; response.setContentType(MimeTypes.TEXT_HTML_8859_1); if (_cacheControl!=null) response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason()); writer.flush(); response.setContentLength(writer.size()); writer.writeTo(response.getOutputStream()); writer.destroy(); }
handleErrorPage(request, writer, code, message);
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); String method = request.getMethod(); if(!HttpMethod.GET.is(method) && !HttpMethod.POST.is(method) && !HttpMethod.HEAD.is(method)) return; response.setContentType(MimeTypes.Type.TEXT_HTML_8859_1.asString()); if (_cacheControl!=null) response.setHeader(HttpHeader.CACHE_CONTROL.asString(), _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); String reason=(response instanceof Response)?((Response)response).getReason():null; handleErrorPage(request, writer, response.getStatus(), reason); writer.flush(); response.setContentLength(writer.size()); writer.writeTo(response.getOutputStream()); writer.destroy(); }
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { baseRequest.setHandled(true); String method = request.getMethod(); if(!HttpMethod.GET.is(method) && !HttpMethod.POST.is(method) && !HttpMethod.HEAD.is(method)) return; response.setContentType(MimeTypes.Type.TEXT_HTML_8859_1.asString()); if (_cacheControl!=null) response.setHeader(HttpHeader.CACHE_CONTROL.asString(), _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); String reason=(response instanceof Response)?((Response)response).getReason():null; handleErrorPage(request, writer, response.getStatus(), reason); writer.flush(); response.setContentLength(writer.size()); writer.writeTo(response.getOutputStream()); writer.destroy(); }
response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason()); writer.flush(); response.setContentLength(writer.size());
response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason()); writer.flush(); response.setContentLength(writer.size());
response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason()); writer.flush(); response.setContentLength(writer.size());
response.setHeader(HttpHeaders.CACHE_CONTROL, _cacheControl); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason()); writer.flush(); response.setContentLength(writer.size());
ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096); String reason=(response instanceof Response)?((Response)response).getReason():null; handleErrorPage(request, writer, response.getStatus(), reason); writer.flush(); response.setContentLength(writer.size());
ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer(4096); String reason = (response instanceof Response) ? ((Response) response).getReason() : null; handleErrorPage(request, writer, response.getStatus(), reason); writer.flush(); response.setContentLength(writer.size());