Chapter 4. Adding workflow with interceptors

 

This chapter covers

  • Firing interceptors
  • Exploring the built-in interceptors
  • Declaring interceptors
  • Building your own interceptors

In the previous chapter, we learned a great deal about the action component of the Struts 2 framework. From a developer’s daily working perspective, the action component may well be the heart and soul of the framework. But working silently in the background are the true heroes of the hour, the interceptors. In truth, interceptors are responsible for most of the processing done by the framework. The built-in interceptors, declared in the struts-default package’s defaultStack, handle most of the fundamental tasks, ranging from data transfer and validation to exception handling. Due to the rich set of the built-in interceptors, you might not need to develop your own interceptor for some time. Nonetheless, the importance of these core Struts 2 components cannot be underestimated. Without an understanding of how interceptors work, you’ll never truly understand Struts 2.

4.1. Why intercept requests?

 

4.2. Interceptors in action

 
 
 

4.3. Surveying the built-in Struts 2 interceptors

 
 
 

4.4. Declaring interceptors

 
 
 
 

4.5. Building your own interceptor

 
 
 
 

4.6. Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest