This is a Java servlet filter (as per Servlet API 2.3). trimFilter lets you decrease the size of file your server will send to all clients. Filter removes extra spaces and line breaks from outputted documents. Especially useful for WAP/WML developers, where the size for transferred documents is limited.
How to use it:
a) download trimflt.jar and save it in WEB-INF/lib
b) describe this filter in web.xml
You can set also an initial parameter removeComments. In this case
filter will remove HTML comments too:
default value for this parameter is false (do not remove comments).
Also you may exclude some of your files from the processing. Parameter
exclude contains a commas separated list of files excluded
from the processing. E.g.:
By default this parameter is empty (do not exclude files).
c) describe a mapping for this filter in web.xml
in this case filter will be on for the each .jsp file
And now when you invoke any .jsp page: http://your_host/your_page.jsp
trimFilter will compress their output.
For downloading: trimflt.jar
You can buy a commercial license here.
See also JSOS - the largest collection of servlets and filters.