* @return A simple html for the given responseStatus.
*/
public static CharSequence renderHtmlError(ResponseStatus responseStatus) {
// Get the responseStatus details.
StatusType status = responseStatus.getStatusType();
ReasonType reason = responseStatus.getReasonType();
String detailedMessage = responseStatus.getDescription();
// Create an xml document with head and an empty body.
Document document = createDocument();
Element bodyElement = appendHeadAndBody(document);
// Populate the xml document.
Element oopsElement = document.createElement("h3");
oopsElement.setTextContent("Oops, an error occured.");
bodyElement.appendChild(oopsElement);
if (status != null) {
String text = "Status: " + status.lowerCaseString();
appendSimpleText(document, bodyElement, text);
}
if (reason != null) {
String text = "Reason: " + reason.getMessageForReasonType(null);
appendSimpleText(document, bodyElement, text);
}
if (detailedMessage != null) {
String text = "Description: " + sanitizeDetailedMessage(detailedMessage);