Modifying the HTTP Response Using Filters
USE : response
Purpose
The response object is an instance of the Servlet API's HttpServletResponse class
Examples
class BookController { def downloadFile = { byte[] bytes = // read bytes response.outputStream << bytes } }
Description
The Servlet API's HttpServletResponse class can be used within Grails to perform all typical activities such as writing out binary data, writing directly to the response and sending error response codes to name but a few.
I think the question relates to ASP.NET, not Java. This might help:
These kind of components are called filters in the Java world. They are capable of modifying requests/responses before they are dispachted to the handler component resp. before the response is delivered to the client.
In ASP.NET these kind of components are called HTTP Modules.
Historically, response filters have been the way to do this in ASP.NET. However, they suffer from some serious cache-related issues, both in IIS6 (tougher to notice) and IIS7. This question includes a KB article with more detail.