Moved to Jakarta EE. Closes #7

This commit is contained in:
Erik C. Thauvin 2022-08-27 18:08:57 -07:00
parent c4edb4fd1f
commit 45af218f39
20 changed files with 224 additions and 139 deletions

View file

@ -1 +1 @@
future-release=1.0.6
future-release=1.1.0

2
.idea/compiler.xml generated
View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
<bytecodeTargetLevel target="11" />
</component>
</project>

5
.idea/misc.xml generated
View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="17" project-jdk-type="JavaSDK" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="18" project-jdk-type="JavaSDK" />
</project>

View file

@ -1,6 +1,6 @@
# Changelog
## [1.0.5](https://github.com/ethauvin/HttpStatus/tree/1.0.5) (2021-03-19)
## [1.0.5](https://github.com/ethauvin/HttpStatus/tree/1.0.5) (2021-03-20)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0.4...1.0.5)

View file

@ -1,4 +1,4 @@
Copyright (c) 2015-2021, Erik C. Thauvin (erik@thauvin.net)
Copyright (c) 2015-2022, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -37,7 +37,7 @@ Include the following in your `build.gradle` file:
```gradle
dependencies {
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.0.6'
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.1.0'
}
```
@ -47,7 +47,7 @@ or as a Maven artifact:
<dependency>
<groupId>net.thauvin.erik.httpstatus</groupId>
<artifactId>httpstatus</artifactId>
<version>1.0.6</version>
<version>1.1.0</version>
</dependency>
```
@ -250,7 +250,7 @@ Status Code | Reason
You can query the reason phrase for status codes as follows:
```sh
$ java -jar httpstatus-1.0.6.jar 404 500
$ java -jar httpstatus-1.1.0.jar 404 500
404: Not Found
500: Internal Server Error
```
@ -258,7 +258,7 @@ $ java -jar httpstatus-1.0.6.jar 404 500
If no status code is specified, all will be printed:
```sh
$ java -jar httpstatus-1.0.6.jar
$ java -jar httpstatus-1.1.0.jar
100: Continue
101: Switching Protocols
102: Processing

View file

@ -16,7 +16,7 @@ test_script:
branches:
only:
- master
- 1.0.6-dev
- 1.1.0-dev
cache:
- C:\Users\appveyor\.gradle

View file

@ -8,8 +8,8 @@ plugins {
id 'pmd'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
id 'com.github.spotbugs' version '5.0.6'
id 'org.sonarqube' version '3.3'
id 'com.github.spotbugs' version '5.0.10'
id 'org.sonarqube' version '3.4.0.2513'
}
import com.github.spotbugs.snom.SpotBugsTask
@ -33,8 +33,8 @@ mainClassName = 'net.thauvin.erik.httpstatus.Reasons'
ext {
versions = [
pmd: '6.35.0',
spotbugs: '4.6.0'
pmd : '6.47.0',
spotbugs: '4.7.1'
]
}
@ -45,9 +45,13 @@ repositories {
}
dependencies {
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly 'javax.servlet.jsp:jsp-api:2.2.1-b03'
compileOnly 'javax.el:javax.el-api:3.0.1-b06'
// compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
// compileOnly 'javax.servlet.jsp:jsp-api:2.2.1-b03'
// compileOnly 'javax.el:javax.el-api:3.0.1-b06'
compileOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0'
compileOnly 'jakarta.servlet.jsp:jakarta.servlet.jsp-api:3.1.0'
compileOnly 'jakarta.el:jakarta.el-api:5.0.1'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
spotbugsPlugins 'com.mebigfatguy.sb-contrib:sb-contrib:7.4.7'
@ -55,7 +59,7 @@ dependencies {
compileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs"
testImplementation 'org.testng:testng:7.5'
testImplementation 'org.testng:testng:7.6.1'
}
tasks.withType(JavaCompile) {
@ -63,8 +67,8 @@ tasks.withType(JavaCompile) {
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
@ -173,7 +177,11 @@ signing {
task copyToDeploy(type: Copy) {
from(configurations.runtimeClasspath) {
exclude('javax.servlet-api-*.jar', 'jsp-api-*.jar')
exclude('javax.servlet-api-*.jar',
'jsp-api-*.jar',
'jakarta.servlet-*.jar',
'jakarta-servlet.*.jar',
'jakarta.el-api*.jar')
}
from jar
into deployDir

4
deploy.sh Normal file
View file

@ -0,0 +1,4 @@
#!/bin/bash
./gradlew deploy
[ $? -eq 0 ] && scp deploy/*.jar nix3.thauvin.us:/opt/lib/jtalk-ee/httpstatus

View file

@ -15,6 +15,7 @@
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@ -49,7 +50,7 @@
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
@ -62,7 +63,7 @@
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
@ -74,46 +75,86 @@
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="github-pandoc.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<h1 id="httpstatus-jsp-tag-library">HttpStatus JSP Tag Library</h1>
<p><a href="https://github.com/ethauvin/httpstatus/releases/latest"><img src="https://img.shields.io/github/release/ethauvin/httpstatus.svg" alt="Release" /></a> <a href="https://search.maven.org/search?q=g:%22net.thauvin.erik.httpstatus%22%20AND%20a:%22httpstatus%22"><img src="https://img.shields.io/maven-central/v/net.thauvin.erik.httpstatus/httpstatus.svg?label=maven%20central" alt="Maven Central" /></a><br />
<a href="http://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square" alt="License (3-Clause BSD)" /></a> <a href="https://snyk.io/test/github/ethauvin/httpstatus?targetFile=build.gradle"><img src="https://snyk.io/test/github/ethauvin/httpstatus/badge.svg?targetFile=build.gradle" alt="Known Vulnerabilities" /></a> <a href="https://sonarcloud.io/dashboard?id=ethauvin_HttpStatus"><img src="https://sonarcloud.io/api/project_badges/measure?project=ethauvin_HttpStatus&amp;metric=alert_status" alt="Quality Gate Status" /></a><br />
<a href="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml"><img src="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml/badge.svg" alt="GitHub CI" /></a> <a href="https://ci.appveyor.com/project/ethauvin/httpstatus"><img src="https://ci.appveyor.com/api/projects/status/w5j4kul3w2rkigxb?svg=true" alt="Build status" /></a> <a href="https://circleci.com/gh/ethauvin/HttpStatus/tree/master"><img src="https://circleci.com/gh/ethauvin/HttpStatus/tree/master.svg?style=shield" alt="CircleCI" /></a></p>
<p>A simple <a href="http://www.oracle.com/technetwork/java/javaee/jsp/index.html">JSP</a> Tag Library to display the <a href="#hscode">code</a>, <a href="#hsreason">reason</a>, <a href="#hscode">cause</a> and/or <a href="#hsmessage">message</a> for <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP status codes</a> in JSP error pages.</p>
<p><a href="https://github.com/ethauvin/httpstatus/releases/latest"><img
src="https://img.shields.io/github/release/ethauvin/httpstatus.svg"
alt="Release" /></a> <a
href="https://search.maven.org/search?q=g:%22net.thauvin.erik.httpstatus%22%20AND%20a:%22httpstatus%22"><img
src="https://img.shields.io/maven-central/v/net.thauvin.erik.httpstatus/httpstatus.svg?label=maven%20central"
alt="Maven Central" /></a><br />
<a href="http://opensource.org/licenses/BSD-3-Clause"><img
src="https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square"
alt="License (3-Clause BSD)" /></a> <a
href="https://snyk.io/test/github/ethauvin/httpstatus?targetFile=build.gradle"><img
src="https://snyk.io/test/github/ethauvin/httpstatus/badge.svg?targetFile=build.gradle"
alt="Known Vulnerabilities" /></a> <a
href="https://sonarcloud.io/dashboard?id=ethauvin_HttpStatus"><img
src="https://sonarcloud.io/api/project_badges/measure?project=ethauvin_HttpStatus&amp;metric=alert_status"
alt="Quality Gate Status" /></a><br />
<a
href="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml"><img
src="https://github.com/ethauvin/httpstatus/actions/workflows/gradle.yml/badge.svg"
alt="GitHub CI" /></a> <a
href="https://ci.appveyor.com/project/ethauvin/httpstatus"><img
src="https://ci.appveyor.com/api/projects/status/w5j4kul3w2rkigxb?svg=true"
alt="Build status" /></a> <a
href="https://circleci.com/gh/ethauvin/HttpStatus/tree/master"><img
src="https://circleci.com/gh/ethauvin/HttpStatus/tree/master.svg?style=shield"
alt="CircleCI" /></a></p>
<p>A simple <a
href="http://www.oracle.com/technetwork/java/javaee/jsp/index.html">JSP</a>
Tag Library to display the <a href="#hscode">code</a>, <a
href="#hsreason">reason</a>, <a href="#hscode">cause</a> and/or <a
href="#hsmessage">message</a> for <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP
status codes</a> in JSP error pages.</p>
<p>For example:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a>&lt;html&gt;&lt;head&gt;</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a>&lt;title&gt;<span class="kw">&lt;hs:code/&gt;</span> <span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/title&gt;</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a>&lt;/head&gt;</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a>&lt;h1&gt;<span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/h1&gt;</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true"></a>Cause: &lt;pre&gt;<span class="kw">&lt;hs:cause</span><span class="ot"> default</span>=<span class="dt">&quot;Unable to complete your request.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true"></a>Message: &lt;pre&gt;<span class="kw">&lt;hs:message</span><span class="ot"> default</span>=<span class="dt">&quot;A server error has occured.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true"></a>...</span></code></pre></div>
<div class="sourceCode" id="cb1"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>&lt;html&gt;&lt;head&gt;</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a>&lt;title&gt;<span class="kw">&lt;hs:code/&gt;</span> <span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/title&gt;</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>&lt;/head&gt;</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>&lt;h1&gt;<span class="kw">&lt;hs:reason</span><span class="ot"> default</span>=<span class="dt">&quot;Server Error&quot;</span><span class="kw">/&gt;</span>&lt;/h1&gt;</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a>Cause: &lt;pre&gt;<span class="kw">&lt;hs:cause</span><span class="ot"> default</span>=<span class="dt">&quot;Unable to complete your request.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a>Message: &lt;pre&gt;<span class="kw">&lt;hs:message</span><span class="ot"> default</span>=<span class="dt">&quot;A server error has occured.&quot;</span><span class="kw">/&gt;</span>&lt;/pre&gt;</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a>...</span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> import</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.Reasons&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a><span class="pp">&lt;%=</span> Reasons.<span class="fu">getReasonPhrase</span>(pageContext.<span class="fu">getErrorData</span>().<span class="fu">getStatusCode</span>()) <span class="pp">%&gt;</span></span></code></pre></div>
<p>would display on a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">501 status code</a>:</p>
<pre><code>Not Implemented
</code></pre>
<h2 id="usage-with-gradle-or-maven">Usage with <a href="https://gradle.org/">Gradle</a> or <a href="http://maven.apache.org/">Maven</a></h2>
<div class="sourceCode" id="cb2"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;%@ page</span><span class="ot"> isErrorPage</span>=<span class="st">&quot;true&quot;</span><span class="ot"> import</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.Reasons&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="pp">&lt;%=</span> Reasons<span class="op">.</span><span class="fu">getReasonPhrase</span><span class="op">(</span>pageContext<span class="op">.</span><span class="fu">getErrorData</span><span class="op">().</span><span class="fu">getStatusCode</span><span class="op">())</span> <span class="pp">%&gt;</span></span></code></pre></div>
<p>would display on a <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">501
status code</a>:</p>
<pre><code>Not Implemented</code></pre>
<h2 id="usage-with-gradle-or-maven">Usage with <a
href="https://gradle.org/">Gradle</a> or <a
href="http://maven.apache.org/">Maven</a></h2>
<p>Include the following in your <code>build.gradle</code> file:</p>
<pre class="gradle"><code>dependencies {
implementation &#39;net.thauvin.erik.httpstatus:httpstatus:1.0.6&#39;
}
</code></pre>
<div class="sourceCode" id="cb4"><pre
class="sourceCode gradle"><code class="sourceCode groovy"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>dependencies <span class="op">{</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> implementation <span class="st">&#39;net.thauvin.erik.httpstatus:httpstatus:1.1.0&#39;</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>or as a Maven artifact:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode xml"><code class="sourceCode xml"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true"></a><span class="kw">&lt;dependency&gt;</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a> <span class="kw">&lt;groupId&gt;</span>net.thauvin.erik.httpstatus<span class="kw">&lt;/groupId&gt;</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a> <span class="kw">&lt;artifactId&gt;</span>httpstatus<span class="kw">&lt;/artifactId&gt;</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true"></a> <span class="kw">&lt;version&gt;</span>1.0.6<span class="kw">&lt;/version&gt;</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true"></a><span class="kw">&lt;/dependency&gt;</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre
class="sourceCode xml"><code class="sourceCode xml"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>&lt;<span class="kw">dependency</span>&gt;</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> &lt;<span class="kw">groupId</span>&gt;net.thauvin.erik.httpstatus&lt;/<span class="kw">groupId</span>&gt;</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> &lt;<span class="kw">artifactId</span>&gt;httpstatus&lt;/<span class="kw">artifactId</span>&gt;</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> &lt;<span class="kw">version</span>&gt;1.1.0&lt;/<span class="kw">version</span>&gt;</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>&lt;/<span class="kw">dependency</span>&gt;</span></code></pre></div>
<h2 id="hscause">hs:cause</h2>
<p>The <code>&lt;hs:cause/&gt;</code> tag displays the cause of current HTTP status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> pageContext.<span class="fu">getErrorData</span>().<span class="fu">getThrowable</span>().<span class="fu">getCause</span>().<span class="fu">getLocalizedMessage</span>() <span class="pp">%&gt;</span></span></code></pre></div>
<p>The <code>&lt;hs:cause/&gt;</code> tag displays the cause of current
HTTP status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="pp">&lt;%=</span> pageContext<span class="op">.</span><span class="fu">getErrorData</span><span class="op">().</span><span class="fu">getThrowable</span><span class="op">().</span><span class="fu">getCause</span><span class="op">().</span><span class="fu">getLocalizedMessage</span><span class="op">()</span> <span class="pp">%&gt;</span></span></code></pre></div>
<p>Optional attributes are:</p>
<table>
<thead>
@ -129,16 +170,22 @@
</tr>
<tr class="even">
<td><code>escapeXml</code></td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a href="http://dev.w3.org/html5/html-author/charref">entity codes</a>. Value is <code>true</code> by default.</td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a
href="http://dev.w3.org/html5/html-author/charref">entity codes</a>.
Value is <code>true</code> by default.</td>
</tr>
</tbody>
</table>
<h2 id="hscode">hs:code</h2>
<p>The <code>&lt;hs:code/&gt;</code> tag displays the current HTTP status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> pageContext.<span class="fu">getErrorData</span>().<span class="fu">getStatusCode</span>() <span class="pp">%&gt;</span></span></code></pre></div>
<p>The <code>&lt;hs:code/&gt;</code> tag displays the current HTTP
status code, if any. A shorthand for:</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="pp">&lt;%=</span> pageContext<span class="op">.</span><span class="fu">getErrorData</span><span class="op">().</span><span class="fu">getStatusCode</span><span class="op">()</span> <span class="pp">%&gt;</span></span></code></pre></div>
<h2 id="hsmessage">hs:message</h2>
<p>The <code>&lt;hs:message/&gt;</code> tag displays the current error message, if any. A shorthand for:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true"></a><span class="pp">&lt;%=</span> request.<span class="fu">getAttribute</span>(<span class="st">&quot;javax.servlet.error.message&quot;</span>) <span class="pp">%&gt;</span></span></code></pre></div>
<p>The <code>&lt;hs:message/&gt;</code> tag displays the current error
message, if any. A shorthand for:</p>
<div class="sourceCode" id="cb8"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="pp">&lt;%=</span> request<span class="op">.</span><span class="fu">getAttribute</span><span class="op">(</span><span class="st">&quot;javax.servlet.error.message&quot;</span><span class="op">)</span> <span class="pp">%&gt;</span></span></code></pre></div>
<p>Optional attributes are:</p>
<table>
<thead>
@ -154,12 +201,15 @@
</tr>
<tr class="even">
<td><code>escapeXml</code></td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a href="http://dev.w3.org/html5/html-author/charref">entity codes</a>. Value is <code>true</code> by default.</td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a
href="http://dev.w3.org/html5/html-author/charref">entity codes</a>.
Value is <code>true</code> by default.</td>
</tr>
</tbody>
</table>
<h2 id="hsreason">hs:reason</h2>
<p>The <code>&lt;hs:reason/&gt;</code> tag displays the reason for a HTTP status code, if any. Optional attributes are:</p>
<p>The <code>&lt;hs:reason/&gt;</code> tag displays the reason for a
HTTP status code, if any. Optional attributes are:</p>
<table>
<thead>
<tr class="header">
@ -170,7 +220,8 @@
<tbody>
<tr class="odd">
<td><code>code</code></td>
<td>The HTTP status error code. If not specified the current status code is used.</td>
<td>The HTTP status error code. If not specified the current status code
is used.</td>
</tr>
<tr class="even">
<td><code>default</code></td>
@ -178,38 +229,43 @@
</tr>
<tr class="odd">
<td><code>escapeXml</code></td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a href="http://dev.w3.org/html5/html-author/charref">entity codes</a>. Value is <code>true</code> by default.</td>
<td>Converts &lt;, &gt;, &amp;, ', " to their corresponding <a
href="http://dev.w3.org/html5/html-author/charref">entity codes</a>.
Value is <code>true</code> by default.</td>
</tr>
</tbody>
</table>
<h2 id="statuscode-bean">StatusCode Bean</h2>
<p>The <code>StatusCode</code> bean can be used to check the class of the status code error. For example, using the JSTL:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;c&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://java.sun.com/jsp/jstl/core&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true"></a></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true"></a><span class="bu">&lt;jsp:useBean</span><span class="ot"> id</span>=<span class="st">&quot;statusCode&quot;</span><span class="ot"> class</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.StatusCode&quot;</span><span class="bu">/&gt;</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true"></a><span class="kw">&lt;c:set</span><span class="ot"> target</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode<span class="pp">}</span><span class="dt">&quot;</span><span class="ot"> property</span>=<span class="dt">&quot;code&quot;</span><span class="kw">&gt;&lt;hs:code/&gt;&lt;/c:set&gt;</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true"></a><span class="kw">&lt;c:choose&gt;</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true"></a> <span class="kw">&lt;c:when</span><span class="ot"> test</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode.<span class="fu">isClientError</span>()<span class="pp">}</span><span class="dt">&quot;</span><span class="kw">&gt;</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true"></a> An error occurred on your side. (<span class="kw">&lt;hs:reason/&gt;</span>)</span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true"></a> <span class="kw">&lt;/c:when&gt;</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true"></a> <span class="kw">&lt;c:otherwise&gt;</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true"></a> An error occurred on our side. (<span class="kw">&lt;hs:message/&gt;</span>)</span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true"></a> <span class="kw">&lt;/c:otherwise&gt;</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true"></a><span class="kw">&lt;/c:choose&gt;</span></span></code></pre></div>
<p>The <code>StatusCode</code> bean can be used to check the class of
the status code error. For example, using the JSTL:</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode jsp"><code class="sourceCode jsp"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;hs&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://erik.thauvin.net/taglibs/httpstatus&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;%@ taglib</span><span class="ot"> prefix</span>=<span class="st">&quot;c&quot;</span><span class="ot"> uri</span>=<span class="st">&quot;http://java.sun.com/jsp/jstl/core&quot;</span><span class="ot"> </span><span class="bu">%&gt;</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="bu">&lt;jsp:useBean</span><span class="ot"> id</span>=<span class="st">&quot;statusCode&quot;</span><span class="ot"> class</span>=<span class="st">&quot;net.thauvin.erik.httpstatus.StatusCode&quot;</span><span class="bu">/&gt;</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="kw">&lt;c:set</span><span class="ot"> target</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode<span class="pp">}</span><span class="dt">&quot;</span><span class="ot"> property</span>=<span class="dt">&quot;code&quot;</span><span class="kw">&gt;&lt;hs:code/&gt;&lt;/c:set&gt;</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="kw">&lt;c:choose&gt;</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">&lt;c:when</span><span class="ot"> test</span>=<span class="dt">&quot;</span><span class="pp">${</span>statusCode<span class="op">.</span><span class="fu">isClientError</span><span class="op">()</span><span class="pp">}</span><span class="dt">&quot;</span><span class="kw">&gt;</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a> An error occurred on your side. (<span class="kw">&lt;hs:reason/&gt;</span>)</span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a> <span class="kw">&lt;/c:when&gt;</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a> <span class="kw">&lt;c:otherwise&gt;</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a> An error occurred on our side. (<span class="kw">&lt;hs:message/&gt;</span>)</span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a> <span class="kw">&lt;/c:otherwise&gt;</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a><span class="kw">&lt;/c:choose&gt;</span></span></code></pre></div>
<p>or in a Servlet:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode java"><code class="sourceCode java"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true"></a><span class="kw">import</span><span class="im"> net.thauvin.erik.httpstatus.StatusCode;</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true"></a></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true"></a><span class="co">// ---</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true"></a></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true"></a>StatusCode statusCode = <span class="kw">new</span> <span class="fu">StatusCode</span>((<span class="bu">Integer</span>) request.<span class="fu">getAttribute</span>(<span class="st">&quot;javax.servlet.error.status_code&quot;</span>));</span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true"></a><span class="kw">if</span> (statusCode.<span class="fu">isError</span>()) {</span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true"></a> <span class="kw">if</span> (statusCode.<span class="fu">isServerError</span>()) {</span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true"></a> <span class="bu">String</span> reason = statusCode.<span class="fu">getReason</span>();</span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true"></a> } <span class="kw">else</span> {</span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true"></a> <span class="co">// ...</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true"></a> }</span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true"></a>}</span></code></pre></div>
<div class="sourceCode" id="cb10"><pre
class="sourceCode java"><code class="sourceCode java"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="kw">import</span> <span class="im">net</span><span class="op">.</span><span class="im">thauvin</span><span class="op">.</span><span class="im">erik</span><span class="op">.</span><span class="im">httpstatus</span><span class="op">.</span><span class="im">StatusCode</span><span class="op">;</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="co">// ---</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a>StatusCode statusCode <span class="op">=</span> <span class="kw">new</span> <span class="fu">StatusCode</span><span class="op">((</span><span class="bu">Integer</span><span class="op">)</span> request<span class="op">.</span><span class="fu">getAttribute</span><span class="op">(</span><span class="st">&quot;javax.servlet.error.status_code&quot;</span><span class="op">));</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>statusCode<span class="op">.</span><span class="fu">isError</span><span class="op">())</span> <span class="op">{</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>statusCode<span class="op">.</span><span class="fu">isServerError</span><span class="op">())</span> <span class="op">{</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">String</span> reason <span class="op">=</span> statusCode<span class="op">.</span><span class="fu">getReason</span><span class="op">();</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a> <span class="co">// ...</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>The <code>StatusCode</code> bean methods are:</p>
<table>
<thead>
@ -221,7 +277,8 @@
<tbody>
<tr class="odd">
<td><code>getReason</code></td>
<td>Returns the reason for the status code (eg: <code>Internal Server Error</code>)</td>
<td>Returns the reason for the status code (eg:
<code>Internal Server Error</code>)</td>
</tr>
<tr class="even">
<td><code>isClientError</code></td>
@ -254,7 +311,9 @@
</tbody>
</table>
<h2 id="reasons">Reasons</h2>
<p>The reasons are defined in a <a href="http://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html">ResourceBundle</a> properties as follows:</p>
<p>The reasons are defined in a <a
href="http://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html">ResourceBundle</a>
properties as follows:</p>
<table>
<thead>
<tr class="header">
@ -631,25 +690,27 @@
</table>
<h2 id="command-line-usage">Command Line Usage</h2>
<p>You can query the reason phrase for status codes as follows:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true"></a>$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar 404 500</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true"></a><span class="ex">404</span>: Not Found</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true"></a><span class="ex">500</span>: Internal Server Error</span></code></pre></div>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> java <span class="at">-jar</span> httpstatus-1.1.0.jar 404 500</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="ex">404:</span> Not Found</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a><span class="ex">500:</span> Internal Server Error</span></code></pre></div>
<p>If no status code is specified, all will be printed:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true"></a>$ <span class="ex">java</span> -jar httpstatus-1.0.6.jar</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true"></a><span class="ex">100</span>: Continue</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true"></a><span class="ex">101</span>: Switching Protocols</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true"></a><span class="ex">102</span>: Processing</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true"></a><span class="ex">103</span>: Early Hints</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true"></a><span class="ex">200</span>: OK</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true"></a><span class="ex">201</span>: Created</span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true"></a><span class="ex">202</span>: Accepted</span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true"></a><span class="ex">203</span>: Non-Authoritative Information</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true"></a><span class="ex">204</span>: No Content</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true"></a><span class="ex">205</span>: Reset Content</span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true"></a><span class="ex">206</span>: Partial Content</span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true"></a><span class="ex">207</span>: Multi-Status</span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true"></a><span class="ex">208</span>: Already Reported</span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true"></a><span class="ex">226</span>: IM Used</span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true"></a><span class="ex">...</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> java <span class="at">-jar</span> httpstatus-1.1.0.jar</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="ex">100:</span> Continue</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="ex">101:</span> Switching Protocols</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="ex">102:</span> Processing</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a><span class="ex">103:</span> Early Hints</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a><span class="ex">200:</span> OK</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a><span class="ex">201:</span> Created</span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="ex">202:</span> Accepted</span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="ex">203:</span> Non-Authoritative Information</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a><span class="ex">204:</span> No Content</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a><span class="ex">205:</span> Reset Content</span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a><span class="ex">206:</span> Partial Content</span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a><span class="ex">207:</span> Multi-Status</span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a><span class="ex">208:</span> Already Reported</span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a><span class="ex">226:</span> IM Used</span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a><span class="ex">...</span></span></code></pre></div>
</body>
</html>

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

6
gradlew vendored
View file

@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

14
gradlew.bat vendored
View file

@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View file

@ -32,10 +32,10 @@
package net.thauvin.erik.httpstatus.taglibs;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.PageContext;
import net.thauvin.erik.httpstatus.Utils;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import java.io.IOException;
/**

View file

@ -32,9 +32,10 @@
package net.thauvin.erik.httpstatus.taglibs;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.PageContext;
import jakarta.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
/**

View file

@ -32,10 +32,10 @@
package net.thauvin.erik.httpstatus.taglibs;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.PageContext;
import net.thauvin.erik.httpstatus.Utils;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import java.io.IOException;
/**
@ -55,7 +55,7 @@ public class MessageTag extends XmlSupport {
@SuppressWarnings("PMD.CloseResource") final JspWriter out = pageContext.getOut();
final String message = (String) pageContext.getRequest().getAttribute(
javax.servlet.RequestDispatcher.ERROR_MESSAGE);
jakarta.servlet.RequestDispatcher.ERROR_MESSAGE);
Utils.outWrite(out, message, defaultValue, escapeXml);
}

View file

@ -32,11 +32,11 @@
package net.thauvin.erik.httpstatus.taglibs;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.PageContext;
import net.thauvin.erik.httpstatus.Reasons;
import net.thauvin.erik.httpstatus.Utils;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import java.io.IOException;
/**

View file

@ -32,7 +32,7 @@
package net.thauvin.erik.httpstatus.taglibs;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import jakarta.servlet.jsp.tagext.SimpleTagSupport;
/**
* Adds support for the <code>default</code> and <code>escapeXml</code> tag attributes.

View file

@ -2,7 +2,7 @@
#Sun May 02 22:01:06 PDT 2021
version.buildmeta=
version.major=1
version.minor=0
version.patch=6
version.minor=1
version.patch=0
version.prerelease=SNAPSHOT
version.semver=1.0.6-SNAPSHOT
version.semver=1.1.0-SNAPSHOT