O'Reilly logo

Struts 2 Design and Programming: A Tutorial by Budi Kurniawan

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

Chapter 18. Custom Interceptors

There are more than a dozen default interceptors that come with Struts. Input validation, for instance, is handled by the Validation interceptor. Unplug this interceptor and validation will stop working. File upload is so smooth thanks to another interceptor, the File Upload interceptor. Some of the interceptors may prevent the action from being executed if certain conditions are not met. For example, the Validation interceptor keeps an action from firing if an error occurs during the validation of that action.

For most applications, the default interceptors are sufficient. However, there are times when you need to create your own interceptor. This chapter explains how.

The Interceptor Interface

Technically, an interceptor ...

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