Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
So far in this chapter, we’ve spent a lot of time looking at the frontend user experience. But there are also important techniques that you need to implement at the backend. In this section we’ll explore the use of filters for augmenting the Grails request/response pipeline with your own custom processing.
Grails filters give you a powerful tool for intercepting every request (or a subset of requests) and for performing business logic before or after the controller action fires. If you’ve worked with Java Servlet filters, you might recognize Grails filters as providing similar functionality, although Grails filters only intercept controller requests, not static file requests for JavaScript, CSS, image files, and the like.