JetRS

JetRS is a fast and lightweight implementation of the JAX-RS v2.0 Specification that runs in a Servlet Container. This project was inspired with the goal to create a better, simpler, easier to use, reliable, and debuggable JAX-RS implementation using the CohesionFirst approach.

License

License

GroupId

GroupId

org.jetrs
ArtifactId

ArtifactId

jetrs
Last Version

Last Version

2.1.0-alpha-3
Release Date

Release Date

Type

Type

pom
Description

Description

JetRS
JetRS is a fast and lightweight implementation of the JAX-RS v2.0 Specification that runs in a Servlet Container. This project was inspired with the goal to create a better, simpler, easier to use, reliable, and debuggable JAX-RS implementation using the CohesionFirst approach.
Project Organization

Project Organization

JetRS
Source Code Management

Source Code Management

https://github.com/jetrs/jetrs

Download jetrs

Filename Size
jetrs-2.1.0-alpha-3.pom 3 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/org.jetrs/jetrs/ -->
<dependency>
    <groupId>org.jetrs</groupId>
    <artifactId>jetrs</artifactId>
    <version>2.1.0-alpha-3</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.jetrs/jetrs/
implementation 'org.jetrs:jetrs:2.1.0-alpha-3'
// https://jarcasting.com/artifacts/org.jetrs/jetrs/
implementation ("org.jetrs:jetrs:2.1.0-alpha-3")
'org.jetrs:jetrs:pom:2.1.0-alpha-3'
<dependency org="org.jetrs" name="jetrs" rev="2.1.0-alpha-3">
  <artifact name="jetrs" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.jetrs', module='jetrs', version='2.1.0-alpha-3')
)
libraryDependencies += "org.jetrs" % "jetrs" % "2.1.0-alpha-3"
[org.jetrs/jetrs "2.1.0-alpha-3"]

Dependencies

compile (4)

Group / Artifact Type Version
javax.ws.rs : javax.ws.rs-api jar 2.1.1
org.libj : logging jar 0.4.5
org.libj : net jar 0.5.2
ch.qos.logback : logback-classic jar 1.2.3

test (3)

Group / Artifact Type Version
org.libj : test jar 0.7.1
junit : junit jar 4.12
org.mockito : mockito-core jar 3.1.0

Project Modules

  • common
  • client
  • server

JetRS

NOTE: This README it outdated!

Build Status Coverage Status Javadocs Released Version Snapshot Version

Introduction

JetRS is an implementation of the JAX-RS v2.0 Specification that runs in a Servlet Container. This project was inspired with the goal to create a better, simpler, easier to use, reliable, and debugable JAX-RS implementation using the CohesionFirst approach.

Getting Started

Prerequisites

  • Java 8 - The minimum required JDK version.
  • Maven - The dependency management system.
  • Servlet Container - A Servlet Container is needed to provide the HTTP service functionality. We recommend Jetty as the ideal starting point for any project.

Example

  1. Add the org.jetrs:server dependency to the POM.

    <dependency>
      <groupId>org.jetrs</groupId>
      <artifactId>server</artifactId>
      <version>2.1.0-alpha-3</version>
    </dependency>
  2. Optionally, you can add the dependency for the MessageBodyReader and MessageBodyWriter provider to integrate the JSONx RS module.

    <dependency>
      <groupId>org.jsonx</groupId>
      <artifactId>jaxrs</artifactId>
      <version>0.3.2</version>
    </dependency>
  3. Create a javax.ws.rs.core.Application.

    @javax.ws.rs.ApplicationPath("/*")
    public class Application extends javax.ws.rs.core.Application {
      @Override
      public java.util.Set<Object> getSingletons() {
        java.util.Set<Object> singletons = new java.util.HashSet<Object>();
        singletons.add(new org.jsonx.rs.JxObjectProvider()); // Optional Provider to parse and marshal JSON messages to Java beans.
        return singletons;
      }
    }
  4. Extend org.jetrs.server.DefaultRESTServlet, pointing to Application.

    @WebServlet(initParams={@WebInitParam(name="javax.ws.rs.Application", value="Application")})
    public class RESTServlet extends org.jetrs.server.DefaultRESTServlet {
    }
  5. Deploy the servlet to a Servlet Container. For an easy embedded servlet container solution, see here for a solution based on Jetty. In the arguments to new Server(8080, ...) add RESTServlet.class as such:

    new Server(8080, RESTServlet.class);

    This will automatically add RESTServlet to the application.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Versions

Version
2.1.0-alpha-3
2.1.0-alpha-2
2.1.0-alpha-1