MultipartRequest
Programmer
i know how to send a compressed page generated by a servlet, but is thre a way to send a compressed JSP?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
out
<%
String encodings = request.getHeader("Accept-Encoding"); PrintWriter outWriter = null;
if ((encodings != null) && (encodings.indexOf("gzip") != -1)) {
/* Get default OutputStream, wrap in GZIPOutputStream */
OutputStream defaultStream = response.getOutputStream();
outWriter = new PrintWriter(new GZIPOutputStream(defaultStream), false);
response.setHeader("Content-Encoding", "gzip");
}
else {
/* Do not send Zipped, get default OutputStream */
outWriter = new PrintWriter(response.getOutputStream(), false);
}
/* Rest of the page using outWriter.println() */
%>