jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: Clarification of threading requirements of section 6.2.3

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Thu, 18 Dec 2014 19:23:20 -0800

Let me try to summarize the discussion.

1. There is a concern on whether FilterChain#doFilter can be called by a
thread other than the container invocation thread.
     Similar question for RequestDispatcher#dispatch.
2. What is the return values of #getContextPath, #getServletPath,
#getPathInfo in case of async?


For (1),
 From Servlet 3.1: A Filter and the target servlet or resource at the
end of the filter chain must execute in the same invocation thread.
This implicitly implies that FilterChain#doFilter should not be called
by a thread other than the container invocation thread.
We would like to make this more explicit in the spec by adding the
following in javadoc of FilterChain#doFilter
     @throw IllegalStateException if it is invoked by a thread other
than the container invocation thread

Any comments?
Shing Wai Chan