jsr340-experts@servlet-spec.java.net

[jsr340-experts] Need clarification on filters

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Mon, 30 Jan 2012 13:08:40 -0800

In an internal platform discussion, there is a question of whether all
filters need to be run in the same thread as in servlets.
In Section 6.2 of Servlet 3.0, there is a description on how filters work.
There is "no" explicit requirement that the filters need to be run in
the same thread.
Is it a tacit assumption?

We propose that the spec ought to say either:

- The service method is required to run in the same thread as all filters
   that apply to the servlet.

or

- The service method is *not* required to run in the same thread as filters
   that apply to the servlet, and filters should not depend on sharing
   thread local data with the servlet.


Shing Wai Chan