/*
* @see org.eclipse.jetty.server.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)
*/
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();
}