views:

368

answers:

1

I'm developing servlet filter intended to manage some resources which should be available during servlet processing. Since I'm not very familiar with the Tomcat, I have some doubt. Is it guaranteed that, for single request, all attached filters and the servlet itself are processed by single (and the same) thread? In other words: can I assume that FilterChain.doFilter() method doesn't use different thread than its caller?

+1  A: 

Yes, this is guaranteed by the servlet specification.

skaffman
Thanks for the answer. Unfortunately, I haven't found anything about filters cooperation whit threads in the specification. Could you please forward me to the appropriate paragraph?
oo_olo_oo
No, I don't have a reference to the spec. I know it to be true, however.
skaffman