Introduction to Interceptors
Stripes provides a facility to add hooks at various stages of your application. These are called Stripes interceptors. Interceptors are classes that implement Stripes’ Interceptor interface and contain an intercept() method. Interceptors are a great way to do things like log requests or build security into an application.
Interceptors use the same
LifecycleStage
enums used by the @Before and @After annotations that we saw in Chapter 11. Refer back to Table 11-1 for details on each life cycle stage.
Let’s jump right in (see Listing 13-1