Skip to content

Creating and Configuring Interceptor

jyotsna-tarento edited this page Jul 25, 2018 · 3 revisions

STEPS TO CREATE INTERCEPTOR

  1. Clone the git repository for open-saber

  2. Create a new interceptor class in registry-interceptor package

  3. This class should implement Spring framework's HandlerInterceptor interface and override the preHandle, postHandle and afterCompletion on need basis

  4. This class can also extend the BaseRequestHandler or BaseResponseHandler to manage requests and response

  5. In order to use the middleware within this interceptor, we can modify the pom.xml in this package to include the dependency

STEPS TO CONFIGURE INTERCEPTOR

  1. Configuration for the interceptor can be added in GenericConfiguration class

  2. While adding this configuration, the route needs to be specified, if not, it would apply to all routes