jsr369-experts@servlet-spec.java.net

[jsr369-experts] [140-ThreadSafetyOfPrintWriter] PROPOSAL

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 23 Sep 2015 16:03:03 -0700

Hello Volunteers,

Mark filed this issue on Monday. As Mark points out, section 2.3.3.4
states:

"the request and response objects are not thread safe."

Given that the PrintWriter is obtained from the admittedly not thread
safe response, and furthermore that this PrintWriter ultimately writes
to the response, it seems safest to say the following.

  Any objects vended from the request or response must be assumed to be
  not thread safe. For example, the PrintWriter returned from
  ServletResponse.getWriter() and the OutputStream returned from
  ServletResponse.getOutputStream() are not thread safe because they
  ultimately interact with the response.

Is that sufficient?

Thanks,

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| 31 Business days til JavaOne 2015
| 46 Business days til DOAG 2015