Skip to content

Latest commit

 

History

History
 
 

backstopper-jersey1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Backstopper - jersey1

Backstopper is a framework-agnostic API error handling and (optional) model validation solution for Java 7 and greater.

This readme focuses specifically on the Backstopper Jersey 1 integration. If you are looking for a different framework integration check out the relevant section of the base readme to see if one already exists. The base project README.md and User Guide contain the main bulk of information regarding Backstopper.

NOTE: There is a Jersey 1 sample application that provides a simple concrete example of the information covered in this readme.

Backstopper Jersey 1 Setup, Configuration, and Usage

Setup

  • Pull in the com.nike.backstopper:backstopper-jersey1 dependency into your project.
  • Register Backstopper components with Jersey 1. Jersey has many ways to configure itself, so this is often a project-specific process. Jersey1BackstopperConfigHelper contains some helpers that will be useful. See the Jersey 1 sample application's Jersey1SampleConfigHelper and Main classes for a concrete example which should help guide you even if you don't end up registering things the same way in your project.
    • This causes Jersey1ApiExceptionHandler to be registered with the Jersey 1 error mapping system so that the Backstopper handlers will take care of all Throwables.
    • Your project's ProjectApiErrors will need to be provided when the Jersey1ApiExceptionHandler is created. ProjectApiErrors creation is discussed in the base Backstopper readme here.
  • Setup the reusable unit tests for your project as described in the base Backstopper readme here and shown in the sample application.

Usage

The base Backstopper readme covers the usage basics. There should be no difference when running in a Jersey 1 environment, other than Jersey1ApiExceptionHandler knowing how to handle Jersey 1 framework exceptions properly (this should happen automatically without any effort from you).

NOTE - Jersey 1 and Servlet API dependencies required at runtime

This backstopper-jersey1 module does not export any transitive Jersey 1 or Servlet API dependencies to prevent runtime version conflicts with whatever Jersey 1 and Servlet environment you deploy to.

This should not affect most users since this library is likely to be used in a Jersey 1/Servlet environment where the required dependencies are already on the classpath at runtime, however if you receive class-not-found errors related to Jersey 1 or Servlet API classes then you'll need to pull the necessary dependency into your project.

The dependencies you may need to pull in:

More Info

See the base project README.md, User Guide, and Backstopper repository source code and javadocs for all further information.

License

Backstopper is released under the Apache License, Version 2.0