Cleanup before 1.1 release

This commit is contained in:
Erik C. Thauvin 2023-09-28 22:01:04 -07:00
parent 3bedb10705
commit 7b3e4adfc8
15 changed files with 61 additions and 66 deletions

1
.idea/misc.xml generated
View file

@ -4,6 +4,7 @@
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" />
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" method="pmd" />
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" method="jacoco" />
<pattern value="net.thauvin.erik.httpstatus.taglibs.ReasonTag" method="setCode" />
</component>
<component name="PDMPlugin">
<option name="customRuleSets">

View file

@ -1,17 +1,27 @@
# Changelog
## [1.0.5](https://github.com/ethauvin/HttpStatus/tree/1.0.5) (2021-03-20)
## [1.1.0](https://github.com/ethauvin/httpstatus/tree/1.1.0) (2023-09-29)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0.4...1.0.5)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0.5...1.1.0)
**Implemented enhancements:**
- Move to Jakarta EE [\#7](https://github.com/ethauvin/HttpStatus/issues/7)
- Only use XML character entities in Utils.escapeXml\(\) [\#6](https://github.com/ethauvin/HttpStatus/issues/6)
- Implement a StatusCode bean to check the status code. [\#5](https://github.com/ethauvin/HttpStatus/issues/5)
## [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)
**Implemented enhancements:**
- Retrieve the error message from the request, if available. [\#4](https://github.com/ethauvin/HttpStatus/issues/4)
- Add Unofficial Codes [\#3](https://github.com/ethauvin/HttpStatus/issues/3)
## [1.0.4](https://github.com/ethauvin/HttpStatus/tree/1.0.4) (2019-05-08)
## [1.0.4](https://github.com/ethauvin/httpstatus/tree/1.0.4) (2019-05-08)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0.3...1.0.4)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0.3...1.0.4)
**Implemented enhancements:**
@ -21,21 +31,21 @@
- hs:reason always outputs the default value. [\#2](https://github.com/ethauvin/HttpStatus/issues/2)
## [1.0.3](https://github.com/ethauvin/HttpStatus/tree/1.0.3) (2016-01-22)
## [1.0.3](https://github.com/ethauvin/httpstatus/tree/1.0.3) (2016-01-22)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0.2...1.0.3)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0.2...1.0.3)
## [1.0.2](https://github.com/ethauvin/HttpStatus/tree/1.0.2) (2016-01-21)
## [1.0.2](https://github.com/ethauvin/httpstatus/tree/1.0.2) (2016-01-21)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0.1...1.0.2)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0.1...1.0.2)
## [1.0.1](https://github.com/ethauvin/HttpStatus/tree/1.0.1) (2015-12-16)
## [1.0.1](https://github.com/ethauvin/httpstatus/tree/1.0.1) (2015-12-16)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/1.0...1.0.1)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0...1.0.1)
## [1.0](https://github.com/ethauvin/HttpStatus/tree/1.0) (2015-12-04)
## [1.0](https://github.com/ethauvin/httpstatus/tree/1.0) (2015-12-04)
[Full Changelog](https://github.com/ethauvin/HttpStatus/compare/ad982eff1b27c31b54df4abae00ac2d4065543d6...1.0)
[Full Changelog](https://github.com/ethauvin/httpstatus/compare/ad982eff1b27c31b54df4abae00ac2d4065543d6...1.0)

View file

@ -1,17 +1,17 @@
# HttpStatus JSP Tag Library
# HttpStatus JSP Tag Library
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/1.7.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://img.shields.io/github/release/ethauvin/httpstatus.svg)](https://github.com/ethauvin/httpstatus/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik.httpstatus/httpstatus.svg?label=maven%20central)](https://search.maven.org/search?q=g:%22net.thauvin.erik.httpstatus%22%20AND%20a:%22httpstatus%22)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/net.thauvin.erik.httpstatus/httpstatus?label=sanpshot&server=https%3A%2F%2Foss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/httpstatus/httpstatus/)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/net.thauvin.erik.httpstatus/httpstatus?label=sanpshot&server=https%3A%2F%2Foss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/httpstatus/httpstatus/)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik.httpstatus/httpstatus.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik.httpstatus/httpstatus)
[![Known Vulnerabilities](https://snyk.io/test/github/ethauvin/httpstatus/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/ethauvin/httpstatus?targetFile=pom.xml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_HttpStatus&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ethauvin_HttpStatus)
[![GitHub CI](https://github.com/ethauvin/httpstatus/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/httpstatus/actions/workflows/bld.yml)
[![CircleCI](https://circleci.com/gh/ethauvin/HttpStatus/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/HttpStatus/tree/master)
A simple [JSP](http://www.oracle.com/technetwork/java/javaee/jsp/index.html) Tag Library to display the [code](#hscode), [reason](#hsreason), [cause](#hscode) and/or [message](#hsmessage) for [HTTP status codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) in JSP error pages.
For example:
@ -35,11 +35,14 @@ or
<%= 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](https://www.rfc-editor.org/rfc/rfc9110.html#name-501-not-implemented):
Not Implemented
```plain
Not Implemented
```
## Usage with [Gradle](https://gradle.org/), [Maven](http://maven.apache.org/) or [bld](https://rife2.com/bld)
## Usage with [Gradle](https://gradle.org/) or [Maven](http://maven.apache.org/)
Include the following in your `build.gradle` file:
```gradle
@ -48,20 +51,28 @@ repositories {
}
dependencies {
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.0.5'
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.1.0'
}
```
or as a Maven artifact:
or as a `Maven` artifact:
```xml
<dependency>
<groupId>net.thauvin.erik.httpstatus</groupId>
<artifactId>httpstatus</artifactId>
<version>1.0.5</version>
<version>1.1.0</version>
</dependency>
```
or in a `bld` build file:
```java
scope(compile).include(
dependency("net.thauvin.erik.httpstatus","httpstatus", version(1, 1, 0))
);
```
## hs:cause
The `<hs:cause/>` tag displays the cause of current HTTP status code, if any. A shorthand for:
@ -78,6 +89,7 @@ Optional attributes are:
| `escapeXml` | Converts &lt;, &gt;, &amp;, ', " to their corresponding [entity codes](http://dev.w3.org/html5/html-author/charref). Value is `true` by default. |
## hs:code
The `<hs:code/>` tag displays the current HTTP status code, if any. A shorthand for:
```jsp
@ -261,6 +273,7 @@ The reasons are defined in a [ResourceBundle](https://docs.oracle.com/en/java/ja
| `599` | Network Connect Timeout Error |
## Command Line Usage
You can query the reason phrase for status codes as follows:
```sh

View file

@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.2
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.0
bld.repositories=RIFE2_SNAPSHOTS,RIFE2_RELEASES,MAVEN_CENTRAL
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1-SNAPSHOT
bld.repositories=MAVEN_LOCAL, RIFE2_SNAPSHOTS,RIFE2_RELEASES,MAVEN_CENTRAL
bld.downloadLocation=
bld.version=1.7.2

View file

@ -6,7 +6,7 @@
<artifactId>httpstatus</artifactId>
<version>1.1.0-SNAPSHOT</version>
<name>HttpStatus</name>
<description>HttpStatus JSP Tag Library</description>
<description>Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages</description>
<url>https://github.com/ethauvin/HttpStatus</url>
<licenses>
<license>

View file

@ -42,6 +42,7 @@ import rife.tools.exceptions.FileUtilsErrorException;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.jar.Attributes;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile;
@ -54,7 +55,7 @@ public class HttpStatusBuild extends Project {
name = "HttpStatus";
version = version(1, 1, 0, "SNAPSHOT");
var description = "HttpStatus JSP Tag Library";
var description = "Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages";
var url = "https://github.com/ethauvin/HttpStatus";
mainClass = "net.thauvin.erik.httpstatus.Reasons";
@ -69,10 +70,12 @@ public class HttpStatusBuild extends Project {
.include(dependency("jakarta.servlet.jsp", "jakarta.servlet.jsp-api", version(3, 1, 1)))
.include(dependency("jakarta.el", "jakarta.el-api", version(5, 0, 1)));
scope(test)
.include(dependency("org.assertj", "assertj-joda-time", version(2, 2, 0)))
.include(dependency("org.assertj", "assertj-core", version(3, 24, 2)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0)));
jarOperation().manifestAttribute(Attributes.Name.MAIN_CLASS, pkg + '.' + "Reasons");
javadocOperation().javadocOptions()
.docTitle(description + ' ' + version.toString())
.docLint(NO_MISSING)
@ -83,7 +86,6 @@ public class HttpStatusBuild extends Project {
.withCredentials(property("sonatype.user"), property("sonatype.password"))
: repository(SONATYPE_RELEASES.location())
.withCredentials(property("sonatype.user"), property("sonatype.password")))
.repository(MAVEN_LOCAL)
.info(new PublishInfo()
.groupId(pkg)
.artifactId(name.toLowerCase())
@ -138,4 +140,4 @@ public class HttpStatusBuild extends Project {
PomBuilder.generateInto(publishOperation().info(), publishOperation().dependencies(),
Path.of(workDirectory.getPath(), "pom.xml").toFile());
}
}
}

View file

@ -39,6 +39,7 @@ import java.io.Serializable;
* The <code>StatusCode</code> bean implements methods to check the class of an HTTP status code.
*
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
* @since 1.1.0
*/
public class StatusCode implements Serializable {
@Serial

View file

@ -43,7 +43,6 @@ import java.io.Writer;
* @since 1.0
*/
public final class Utils {
/**
* Disables the default constructor.
*

View file

@ -57,6 +57,7 @@ public abstract class XmlSupport extends SimpleTagSupport {
*
* @param defaultValue The default value.
*/
@SuppressWarnings("unused")
public void setDefault(final String defaultValue) {
this.defaultValue = defaultValue;
}
@ -66,6 +67,7 @@ public abstract class XmlSupport extends SimpleTagSupport {
*
* @param escapeXml <code>true</code> or <code>false</code>
*/
@SuppressWarnings("unused")
public void setEscapeXml(final boolean escapeXml) {
this.escapeXml = escapeXml;
}

View file

@ -37,7 +37,7 @@
<description>HttpStatus JSP Tag Library</description>
<display-name>HttpStatus JSP Tags</display-name>
<tlib-version>1.0.5</tlib-version>
<tlib-version>1.1.0</tlib-version>
<short-name>hs</short-name>
<uri>http://erik.thauvin.net/taglibs/httpstatus</uri>

View file

@ -1,35 +1,3 @@
#
# reasons.properties
#
# Copyright 2015-2023 Erik C. Thauvin (erik@thauvin.net)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of this project nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
100=Continue
101=Switching Protocols
102=Processing

View file

@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Implements the CauseTagTest class.
*
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
* @since 1.1.0
*/
class CauseTagTest {
@Test

View file

@ -38,7 +38,6 @@ import java.util.ResourceBundle;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Reasons Tests.
*

View file

@ -42,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* StatusCode Tests.
*
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
* @since 1.1.0
*/
class StatusCodeTest {
@Test

View file

@ -39,7 +39,6 @@ import java.io.StringWriter;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Utils Tests.
*