IllegalStateException: Header already sent
March 9th, 2009
Applies to:
Description:
Error while trying to set a header after writing an entry to the ouput stream of the response.
Cause:
When the content of the response is already written, headers cannot be longer set.
Set the header before writing an entry to the output stream.
Example:
response.setContentType(“text/html”);
OutputStream out = response.getOutputStream();
out.writeln(“Test”);
out.flush();