Creating and Configuring Interceptor - Sunbird-RC/open-saber GitHub Wiki
STEPS TO CREATE INTERCEPTOR
-
Clone the git repository for open-saber
-
Create a new interceptor class in registry-interceptor package
-
This class should implement Spring framework's HandlerInterceptor interface and override the preHandle, postHandle and afterCompletion on need basis
-
This class can also extend the BaseRequestHandler or BaseResponseHandler to manage requests and response
-
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
-
Configuration for the interceptor can be added in GenericConfiguration class
-
While adding this configuration, the route needs to be specified, if not, it would apply to all routes