[SERVLET_SPEC-10] Character encoding setting after ServletResponse#reset Created: 20/Sep/11 Updated: 13/Jan/12 Resolved: 13/Jan/12
|Reporter:||Shing Wai Chan||Assignee:||Shing Wai Chan|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
From javadoc, ServletResponse#reset will clear any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.
Once the headers are cleared, so is the charset in Content-Type.
|Comment by markt_asf [ 21/Sep/11 ]|
I assume that the proposed solution is that calling reset() also resets whatever tracking mechanism is used to determine that getWriter() or getOutputStream() has been called and thereby allowing the user to effectively start again.
|Comment by Shing Wai Chan [ 21/Sep/11 ]|
If we reset the state for determining whether getWriter() and getOutputStream() has been called, then we need to clarify what happens to existing Writer or OutputStream. Then we need to clarify the behaviors of the existing writer or outputstream.
|Comment by markt_asf [ 22/Sep/11 ]|
The spec should state that if the response is reset the Writer/OutputStream should no longer be used. Behaviour if there are used is undefined / throws ISE (I have have a slight preference for undefined since that means less work for me ).
As it happens, Tomcat will happily allow the Writer or OutputStream to be re-used although getWriter(), reset(), getOutputStream() will allow the Writer and OutputStream to be used together which might lead to some strange results.
|Comment by Shing Wai Chan [ 13/Jan/12 ]|