Added more status codes and reason strings.

This commit is contained in:
Erik C. Thauvin 2015-12-03 00:10:45 -08:00
parent 27ab841a85
commit 0c0e8bf0c5
5 changed files with 67 additions and 113 deletions

View file

@ -41,89 +41,5 @@
<SOURCES /> <SOURCES />
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.testng:testng:6.9.9">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.9.9/1bf509349476d6a48978cc2b04af9caa907781ab/testng-6.9.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.9.9/45c07e00b4cea80ac8715deb749a54d784f7cb6/testng-6.9.9-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: junit:junit:4.10">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.10/e4f1766ce7404a08f45d859fb9c226fc9e41a861/junit-4.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.10/6c98d6766e72d5575f96c9479d1c1d3b865c6e25/junit-4.10-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: com.beust:jcommander:1.48">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.48/bfcb96281ea3b59d626704f74bc6d625ff51cbce/jcommander-1.48.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.48/6deefcf90f144dfca29d4950c665a592ba029d42/jcommander-1.48-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.apache.ant:ant:1.7.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant/1.7.0/9746af1a485e50cf18dcb232489032a847067066/ant-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant/1.7.0/58ec0e378f1d33cb72a92ee3a9442909789090db/ant-1.7.0-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.yaml:snakeyaml:1.15">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.15/3b132bea69e8ee099f416044970997bde80f4ea6/snakeyaml-1.15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.15/7dc55271cad1cf73bb495e372164269e75d9345a/snakeyaml-1.15-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.beanshell:bsh:2.0b4">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.beanshell/bsh/2.0b4/a05f0a0feefa8d8467ac80e16e7de071489f0d9c/bsh-2.0b4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.hamcrest:hamcrest-core:1.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/860340562250678d1a344907ac75754e259cdb14/hamcrest-core-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/2ccf1154d1a8936042a8a742dc3e611d02ac7213/hamcrest-core-1.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: org.apache.ant:ant-launcher:1.7.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant-launcher/1.7.0/e7e30789211e074aa70ef3eaea59bd5b22a7fa7a/ant-launcher-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>

View file

@ -227,26 +227,6 @@
</item> </item>
</group> </group>
</component> </component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Android Lint</id>
</State>
<State>
<id>Java</id>
</State>
<State>
<id>Portability issuesJava</id>
</State>
</expanded-state>
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Remove" />
@ -265,6 +245,9 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.8.x" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.8.x" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>
<state key="ProjectJDKs.UI"> <state key="ProjectJDKs.UI">

View file

@ -20,7 +20,7 @@ or
```jsp ```jsp
<%@ page isErrorPage="true" import="net.thauvin.erik.httpstatus.Reasons" %> <%@ page isErrorPage="true" import="net.thauvin.erik.httpstatus.Reasons" %>
<%= Reasons.getReasonPhrase(501) %> <%= Reasons.getReasonPhrase(pageContext.getErrorData().getStatusCode()) %>
``` ```
would display on a [501 status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2): would display on a [501 status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2):
@ -36,7 +36,7 @@ Attribute | Description
`statusCode` | The HTTP status error code. If not specified the current status code is used. | No `statusCode` | The HTTP status error code. If not specified the current status code is used. | No
`default` | The fallback value to output. | No `default` | The fallback value to output. | No
The reasons are defined as follows: The reasons are defined in a [ResourceBundle](http://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html) properties as follows:
Status Code | Reason Status Code | Reason
----------- | ------------------------------- ----------- | -------------------------------
@ -51,13 +51,17 @@ Status Code | Reason
`205` | Reset Content `205` | Reset Content
`206` | Partial Content `206` | Partial Content
`207` | Multi-Status `207` | Multi-Status
`208` | Already Reported
`226` | IM Used
`300` | Multiple Choices `300` | Multiple Choices
`301` | Moved Permanently `301` | Moved Permanently
`302` | Moved Temporarily `302` | Moved Temporarily
`303` | See Other `303` | See Other
`304` | Not Modified `304` | Not Modified
`305` | Use Proxy `305` | Use Proxy
`306` | Switch Proxy
`307` | Temporary Redirect `307` | Temporary Redirect
`308` | Permanent Redirect
`400` | Bad Request `400` | Bad Request
`401` | Unauthorized `401` | Unauthorized
`402` | Payment Required `402` | Payment Required
@ -76,15 +80,41 @@ Status Code | Reason
`415` | Unsupported Media Type `415` | Unsupported Media Type
`416` | Requested Range Not Satisfiable `416` | Requested Range Not Satisfiable
`417` | Expectation Failed `417` | Expectation Failed
`418` | I'm A Teapot
`419` | Insufficient Space on Resource `419` | Insufficient Space on Resource
`420` | Method Failure `420` | Method Failure
`421` | Misdirected Request
`422` | Unprocessable Entity `422` | Unprocessable Entity
`423` | Locked `423` | Locked
`424` | Failed Dependency `424` | Failed Dependency
`426` | Upgrade Required
`428` | Precondition Required
`429` | Too Many Requests
`431` | Request Header Fields Too Large
`440` | Login Timeout
`444` | No Response
`449` | Retry With
`450` | Blocked by Windows Parental Controls
`451` | Unavailable For Legal Reasons
`494` | Request Header Too Large
`495` | Cert Error
`496` | No Cert
`497` | HTTP to HTTPS
`498` | Token Expired/Invalid
`499` | Client Closed Request
`500` | Internal Server Error `500` | Internal Server Error
`501` | Not Implemented `501` | Not Implemented
`502` | Bad Gateway `502` | Bad Gateway
`503` | Service Unavailable `503` | Service Unavailable
`504` | Gateway Timeout `504` | Gateway Timeout
`505` | HTTP Version Not Supported `505` | HTTP Version Not Supported
`506` | Variant Also Negotiates
`507` | Insufficient Storage `507` | Insufficient Storage
`508` | Loop Detected
`509` | Bandwidth Limit Exceeded
`510` | Not Extended
`511` | Network Authentication Required
`520` | Unknown Error
`522` | Origin Connection Time-out
`598` | Network Read Timeout Error
`599` | Network Connect Timeout Error

View file

@ -21,11 +21,6 @@ repositories {
dependencies { dependencies {
compile 'servletapi:servlet-api:+' compile 'servletapi:servlet-api:+'
compile 'javax.servlet.jsp:jsp-api:+' compile 'javax.servlet.jsp:jsp-api:+'
testCompile 'org.testng:testng:+'
}
test {
useTestNG()
} }
compileJava { compileJava {

View file

@ -9,13 +9,17 @@
205=Reset Content 205=Reset Content
206=Partial Content 206=Partial Content
207=Multi-Status 207=Multi-Status
208=Already Reported
226=IM Used
300=Multiple Choices 300=Multiple Choices
301=Moved Permanently 301=Moved Permanently
302=Moved Temporarily 302=Moved Temporarily
303=See Other 303=See Other
304=Not Modified 304=Not Modified
305=Use Proxy 305=Use Proxy
306=Switch Proxy
307=Temporary Redirect 307=Temporary Redirect
308=Permanent Redirect
400=Bad Request 400=Bad Request
401=Unauthorized 401=Unauthorized
402=Payment Required 402=Payment Required
@ -34,15 +38,41 @@
415=Unsupported Media Type 415=Unsupported Media Type
416=Requested Range Not Satisfiable 416=Requested Range Not Satisfiable
417=Expectation Failed 417=Expectation Failed
418=I'm A Teapot
419=Insufficient Space on Resource 419=Insufficient Space on Resource
420=Method Failure 420=Method Failure
421=Misdirected Request
422=Unprocessable Entity 422=Unprocessable Entity
423=Locked 423=Locked
424=Failed Dependency 424=Failed Dependency
426=Upgrade Required
428=Precondition Required
429=Too Many Requests
431=Request Header Fields Too Large
440=Login Timeout
444=No Response
449=Retry With
450=Blocked by Windows Parental Controls
451=Unavailable For Legal Reasons
494=Request Header Too Large
495=Cert Error
496=No Cert
497=HTTP to HTTPS
498=Token Expired/Invalid
499=Client Closed Request
500=Internal Server Error 500=Internal Server Error
501=Not Implemented 501=Not Implemented
502=Bad Gateway 502=Bad Gateway
503=Service Unavailable 503=Service Unavailable
504=Gateway Timeout 504=Gateway Timeout
505=HTTP Version Not Supported 505=HTTP Version Not Supported
506=Variant Also Negotiates
507=Insufficient Storage 507=Insufficient Storage
508=Loop Detected
509=Bandwidth Limit Exceeded
510=Not Extended
511=Network Authentication Required
520=Unknown Error
522=Origin Connection Time-out
598=Network Read Timeout Error
599=Network Connect Timeout Error