My Tomcat servlet generate CSS from several patterns dynamically.
After CSS manipulations done, servlet return it.
I want minimize generated CSS.
What way I can minimize CSS before response?
- Java routines
- External library
- Other
Sample of GET handler:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
StringBuilder cssContent = new StringBuilder();
/* Some CSS manipulations */
/* Now cssContent contain generated CSS. Lets return it. */
/* Minimize before response!!! - How? */
response.setContentType("text/css");
response.setStatus(200);
response.getWriter().write(cssContent.toString());
}