I know that I can gzip the output stream using something like ..
OutputStream outA = response.getOutputStream();
outWriter = new PrintWriter(new GZIPOutputStream(outA), false);
response.setHeader("Content-Encoding", "gzip");
outWriter.println(.....);
outWriter.close();
in JSP, but is it possible to write it as:
OutputStream outA = response.getOutputStream ();
outWriter = new PrintWriter (new GZIPOutputStream (outA), false);
response.setHeader ("Content-Encoding", "gzip");
%>
...
I know that this is done in PHP, for example, by grabbing the output buffer before flushing it, gzipping the buffer and then finally writing it.
But is this possible in JSP?
source
share