From a0995c302463474415c3eb3397c0094d70acc0b3 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 2 Dec 2015 18:44:44 -0800 Subject: [PATCH] Added README. --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd9595e --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# HttpStatus JSP Tag Library + +A simple JSP Tag Library to display the reason of [HTTP status codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) in JSP error pages. + +---- + +For example: + +```jsp +<%@ page isErrorPage="true" %> +<%@ taglib prefix="hs" uri="http://erik.thauvin.net/taglibs/httpstatus" %> + +${pageContext.errorData.statusCode} <hs:reason default="Server Error"/> + +

+... +``` + +or + +```jsp +<%@ page isErrorPage="true" import="net.thauvin.erik.httpstatus.Reasons" %> +<%= Reasons.getReasonPhrase(501) %> +``` + +would display on a [501 status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2): + + Not Implemented + +---- + +The **** tag attributes are: + +Attribute | Description | Required +------------ | ----------------------------------------------------------------------------- | -------- +`statusCode` | The HTTP status error code. If not specified the current status code is used. | No +`default` | The fallback value to output. | No \ No newline at end of file