White space included in the template text of JSP pages is preserved by default. This can have undesirable effects. For example, a carriage return added after a taglib directive would be added to the response output as an extra line.
If you want to eliminate the extra white space from the page, you can add a trim-directive-whitespaces element to a jsp-property-group element in the deployment descriptor and set it to true.
To set the trim-directive-whitespaces element to true using NetBeans 5.5, do the following:
Open the deployment descriptor file in the editor.
Click the Pages button at the top of the editor.
Select a JSP property group.
Select the Trim Directive Whitespaces check box.
Save the deployment descriptor.
Alternatively, a page author can set the value of the trimDirectiveWhitespaces attribute of the page directive to true or false. This will override the value specified in the deployment descriptor.
Custom tag authors can eliminate white space from the output generated by a tag file by setting the trimDirectiveWhiteSpace attribute of the tag directive to true.