title: Is doFilter() executed before or after the Servlet's work is done?
body: <p>The <a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" rel="noreferrer">javax.servlet.Filter</a> object can be used both for authentication (where the Filter needs to catch the request before any servlet work needs to be done) and for XSLT translation (where the servlet needs to be completely finished generating content). When does it actually get executed?</p>
  
  <p>I know this is implementation dependent (on the web container), but this seems to be problem that needs to be solved by all of them.</p>
  
  <p>Maybe there is a configuration option set somewhere for each Filter registration with the web container?</p>
  
  <p><strong>Additional:</strong></p>
  
  <p>Also, what governs the order of Filter execution? Why would FooFilter get executed before BarFilter?</p>