public static synchronized java.nio.ByteBuffer | getErrorPage(java.lang.String message, java.lang.String code)When Grizzlu has reached its connection-queue pool limits, an HTML
error pages will to be returned to the clients.
String body = prepareBody(message);
reponseBuffer.clear();
reponseBuffer.put(code);
appendHeaderValue("Content-Type", "text/html");
appendHeaderValue("Content-Length", body.getBytes().length + "");
appendHeaderValue("Date", new Date().toString());
appendHeaderValue("Connection", "Close");
appendHeaderValue("Server", SelectorThread.SERVER_NAME);
reponseBuffer.put(NEWLINE);
reponseBuffer.put(body);
reponseBuffer.flip();
return encoder.encode(reponseBuffer);
|