Is there a way to compress the result of the JSP and return it to the browser? Most browsers support GZIP and I have compressed straight HTML and also used this technique with XML/XSL. Btw, I am using a servlet-centric approach.
Working strictly within the servlet 2.2 spec, it is not possible. The main problem is that there is no support for filtering the content of a generated servlet of JSP. The additional problem for JSPs is that they call getWriter(), afterwhich you cannot call getServletOutputStream(). This is significant because the Writer will encode data, and while that's fine for XML, that's not ok with a GZIP stream.
When servlets first came out (on the JavaWeb Server and with the JSDK), there was a concept of servlet chaining. This allowed you to specify that an internal mime-type would execute another servlet. That new servlet would read the output of the first servlet as it's input stream. i.e., servlet1 or JSP1 generates a page, sets the content-type to internal/compress, the servlet engine associates the mime-type internal/compress with CompressServlet, CompressServlet runs reading the output of the first servlet and compresses and streams the gzip content out. Some commercial servlet engines such as Allaire's JRun still supports this concept. We used servlet chaining to do useful tasks such as stripping unnecessary white space, and dynamically creating zip files of whatever you wanted on the server.