views:

995

answers:

2

Is anyone familiar with a technique for removal of whitespace that results from the use of tag libraries such as JSTL? I know that you can do this in Tomcat via a trimSpaces initialization parameter, but does anyone have similar experience doing this type of thing within WebSphere App Server?

A: 

If you're using version 2.1 or later of the JSP spec, you can simply include the following directive in your JSP, which will strip out whitespace before sending the resultant payload over the wire:

<%@ page trimDirectiveWhitespaces="true" %>
adamrice32