aspose file tools
The moose likes Servlets and the fly likes Request Filter vs Response Filters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Request Filter vs Response Filters" Watch "Request Filter vs Response Filters" New topic
Author

Request Filter vs Response Filters

Gautam Verma
Greenhorn

Joined: Dec 15, 2010
Posts: 4

Like their is request filters which are invoked before the request goes to servlet.
Is the response filter are invoked after the servlet completes?

Can anyone elaborately explain the difference between these two?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3786
    
    1

They're actually the same thing. If you look at the documentation, you'll see that the doFilter method takes a ServletRequest and a ServletResponse as an argument. The filters will be called twice, once on the way in and once on the way out again (in reverse order).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request Filter vs Response Filters
 
Similar Threads
Filter
servlet filter and request/resposnse wrapper
Question on Sequence diagram
Regarding filter invocation
Who is First Filter or Servlet