HttpStatus JSP Tag Library https://github.com/ethauvin/httpstatus
Find a file
2015-12-02 19:46:24 -08:00
gradle/wrapper Initial commit. 2015-12-02 18:23:54 -08:00
src/main Initial commit. 2015-12-02 18:23:54 -08:00
.gitignore Initial commit. 2015-12-02 18:23:54 -08:00
build.gradle Initial commit. 2015-12-02 18:23:54 -08:00
buildnumber.properties Initial commit. 2015-12-02 18:23:54 -08:00
gradlew Initial commit. 2015-12-02 18:23:54 -08:00
gradlew.bat Initial commit. 2015-12-02 18:23:54 -08:00
HttpStatus.iml Initial commit. 2015-12-02 18:23:54 -08:00
HttpStatus.ipr Initial commit. 2015-12-02 18:23:54 -08:00
README.md Added README. 2015-12-02 19:46:24 -08:00
settings.gradle Initial commit. 2015-12-02 18:23:54 -08:00

HttpStatus JSP Tag Library

A simple JSP Tag Library to display the reason of HTTP status codes in JSP error pages.


For example:

<%@ page isErrorPage="true" %>
<%@ taglib prefix="hs" uri="http://erik.thauvin.net/taglibs/httpstatus" %>
<html><head>
<title>${pageContext.errorData.statusCode} <hs:reason default="Server Error"/></title>
</head>
<h1><hs:reason default="Server Error"/></h1>
...

or

<%@ page isErrorPage="true" import="net.thauvin.erik.httpstatus.Reasons" %>
<%= Reasons.getReasonPhrase(501) %>

would display on a 501 status code:

Not Implemented

The hs:reason 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