tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Whitespace generated by JSTL tags
Date Wed, 22 Jan 2003 12:24:07 GMT


Corby Jacobs wrote:
>1) whitespace the developer added to make the JSP more readable seems to
be repeated in the HTML sent to the client (and duplicated >if it's inside
a <c:forEach> tag)
>My question is this:  Is there any way to avoid all this whitespace caused
by core JSTL tags?

I recently noticed that the Ant 1.5 added "ReplaceRegExp" optional task.

My idea is (... haven't tried yet but will do soon) to filter the manually
written JSP files by ReplaceRegExp task with the match="^\s*" replace=""
attributes. This will chomp off the leading " " and "\t" chars in each
lines for readablity, leaving newlines there. You can do this filtering
when you replicate JSPs from the src dir to the build dir to create a .war
file for deployment.

I suppose this very low-tech (therefore, safe) code de-cosmetics will have
noticeable effect for decreasing the size of the JSP response.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message