Optimize taglib ver. 1.5

    Custom JSP taglib. Body tag Suppress lets you decrease the size of file your server will send to all clients. Deletes extra spaces and line breaks from your file. Also maybe useful for WAP developers where the size of any page is limited.

    How to use it? Just present all your JSP code as a body for this tag (in other words wrap your JSP stuff with this tag):

<%@ taglib uri="taglib.tld" prefix="opt" %>
   // Your JSP/HTML page is here

    Body tag Compress will compress own body (gzip) and send compressed data to client with gzip-encoding support. For example:

<%@ taglib uri="taglib.tld" prefix="opt" %>
   // All your JSP/HTML page is here

For Compress filter make sure this tag is a first line on your JSP page. E.g. it is some like so:

<%@ page language="java" contentType="text/html; charset=UTF-8" %><%@ taglib uri="taglib.tld" prefix="c" %><c:Compress>
your content is here

Tags are:


Body tag, removes white spaces. Attributes are:

1) removeComments Optional parameter. Lets you delete HTML comments also. Possible values are true or false. Default value is false (do not remove comments).


Body tag, compresses own body. Attributes are:

1) contentType Optional attribute. Lets you describe a content type for the compressed content. Default value is text/html.
2) encoding Optional attribute. Lets you describe an encoding for the compressed content. Default value is UTF-8.

for downloading:

Library: opttags.jar    Description: taglib.tld

 © Coldbeans Software      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in JSOS: