O'Reilly logo

Stripes by Example by Brent Watson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Brent Watson 2015
Brent WatsonStripes by Example10.1007/978-1-4842-0980-6_13

13. Interceptors

Brent Watson 
(1)
316 Marine Ave, Brooklyn, USA
 
 
Brent Watson

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required