From 37fad706ecbce0f6c922fd4a0cf4764b73bbc53f Mon Sep 17 00:00:00 2001
From: "Erik C. Thauvin"
A simple JSP Tag Library to display the code, reason and/or cause for HTTP status codes in JSP error pages.
-For example:
<%@ page isErrorPage="true" %>
<%@ taglib prefix="hs" uri="http://erik.thauvin.net/taglibs/httpstatus" %>
@@ -101,7 +100,6 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
would display on a 501 status code:
Not Implemented
-
hs:cause
The <hs:cause/>
tag displays the cause of current HTTP status code, if any. A shorthand for:
@@ -478,7 +476,6 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
-
Usage with Gradle or Maven
Include the following in your build.gradle
file:
dependencies {
@@ -491,5 +488,27 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<artifactId>httpstatus</artifactId>
<version>1.0.4</version>
</dependency>
You can query the reason phrase for status code(s) as follows:
+ +If no status code is specified, all status codes will be printed:
+$ java -jar httpstatus-1.0.4.jar
+100: Continue
+101: Switching Protocols
+102: Processing
+103: Early Hints
+200: OK
+201: Created
+202: Accepted
+203: Non-Authoritative Information
+204: No Content
+205: Reset Content
+206: Partial Content
+207: Multi-Status
+208: Already Reported
+226: IM Used
+...