Backstopper is a framework-agnostic API error handling and (optional) model validation solution for Java 17 and greater.
(NOTE: The Backstopper 1.x branch contains a version of
Backstopper for Java 7+, and for the javax
ecosystem. The current Backstopper supports Java 17+ and the jakarta
ecosystem.)
This library is intended to be used as a base for creating framework-specific integrations with other Servlet-based frameworks that Backstopper doesn't already have support for.
It contains the following classes:
ApiExceptionHandlerServletApiBase
- An extension of the coreApiExceptionHandlerBase
that takes in aHttpServletRequest
andHttpServletResponse
and does the necessary adaptation for calling theApiExceptionHandlerBase
super
methods.UnhandledExceptionHandlerServletApiBase
- An extension of the coreUnhandledExceptionHandlerBase
that takes in aHttpServletRequest
andHttpServletResponse
and does the necessary adaptation for calling theUnhandledExceptionHandlerBase
super
methods.RequestInfoForLoggingServletApiAdapter
- The adapter used byApiExceptionHandlerServletApiBase
andUnhandledExceptionHandlerServletApiBase
for exposingHttpServletRequest
as theRequestInfoForLogging
needed by the core Backstopper components.
This backstopper-servlet-api
module does not export any transitive Servlet API dependency to prevent runtime
version conflicts with whatever Servlet environment you deploy to.
This should not affect most users since this library is likely to be used in a Servlet environment where the required dependencies are already on the classpath at runtime, however if you receive class-not-found errors related to Servlet API classes then you'll need to pull the necessary dependency into your project.
The dependency you may need to pull in:
- Jakarta Servlet API: jakarta.servlet:jakarta.servlet-api:[servlet-api-version]
See the base project README.md, User Guide, and Backstopper repository source code and javadocs for all further information.
Backstopper is released under the Apache License, Version 2.0