Class HtmlHelper
- java.lang.Object
-
- org.glassfish.grizzly.http.server.util.HtmlHelper
-
public class HtmlHelper extends Object
Utility class used to generate HTML pages.- Author:
- Jean-Francois Arcand
-
-
Constructor Summary
Constructors Constructor Description HtmlHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetErrorPage(String headerMessage, String message, String serverName)static StringgetExceptionErrorPage(String headerMessage, String message, String serverName, Throwable t)static voidsendErrorPage(Request request, Response response, ErrorPageGenerator generator, int status, String reasonPhrase, String description, Throwable exception)Generate and send an error page for the given HTTP response status.static voidsetErrorAndSendErrorPage(Request request, Response response, ErrorPageGenerator generator, int status, String reasonPhrase, String description, Throwable exception)Generate and send an error page for the given HTTP response status.static voidwriteTraceMessage(Request request, Response response)
-
-
-
Method Detail
-
sendErrorPage
public static void sendErrorPage(Request request, Response response, ErrorPageGenerator generator, int status, String reasonPhrase, String description, Throwable exception) throws IOException
Generate and send an error page for the given HTTP response status. UnlikesetErrorAndSendErrorPage(org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.Response, org.glassfish.grizzly.http.server.ErrorPageGenerator, int, java.lang.String, java.lang.String, java.lang.Throwable), this method doesn't change theResponsestatus code and reason phrase.- Parameters:
request-response-generator-status-reasonPhrase-description-exception-- Throws:
IOException
-
setErrorAndSendErrorPage
public static void setErrorAndSendErrorPage(Request request, Response response, ErrorPageGenerator generator, int status, String reasonPhrase, String description, Throwable exception) throws IOException
Generate and send an error page for the given HTTP response status. UnlikesetErrorAndSendErrorPage(org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.Response, org.glassfish.grizzly.http.server.ErrorPageGenerator, int, java.lang.String, java.lang.String, java.lang.Throwable), this method does change theResponsestatus code and reason phrase.- Parameters:
request-response-generator-status-reasonPhrase-description-exception-- Throws:
IOException
-
writeTraceMessage
public static void writeTraceMessage(Request request, Response response) throws IOException
- Throws:
IOException
-
getErrorPage
public static String getErrorPage(String headerMessage, String message, String serverName)
- Returns:
- A
Stringcontaining the HTTP response.
-
-