Jetty9 - The output type should be set _after_ calling setCharacterEncoding().

This commit is contained in:
Simone Bordet 2012-08-23 14:51:54 +02:00
parent c50e7ff742
commit f4fd02975d
1 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
@ -653,7 +652,6 @@ public class Response implements HttpServletResponse
{
if (_outputType == OutputType.STREAM)
throw new IllegalStateException("STREAM");
_outputType = OutputType.WRITER;
if (_writer == null)
{
@ -679,6 +677,9 @@ public class Response implements HttpServletResponse
{
_writer = new PrintWriter(new EncodingHttpWriter(_out, encoding));
}
// Set the output type at the end, because setCharacterEncoding() checks for it
_outputType = OutputType.WRITER;
}
return _writer;
}