CSS trim Filter ver. 1.2

This is a Java servlet filter (as per Servlet API 2.3). csstrimFilter lets you decrease the size of JavaScript file your server will send to all clients. Filter removes extra spaces and line breaks from CSS code. For modern web applications the size for CSS files is huge, so you can save a lot of traffic with this filter.

How to use it:

a) download csstrimflt.jar and save it in WEB-INF/lib

b) describe this filter in web.xml


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 .css file

And now when you include any .css file:

<link rel='stylesheet' type='text/css' href='style.css' />

csstrimFilter will compress it.

    For downloading:   csstrimflt.jar

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.


Also in JSOS: