You need to tell the JSP servlet to trim directive whitespaces. You can achieve that by adding the following entry to webapp's web.xml
:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Or, if you'd like to configure it server-wide instead of on a per-webapp basis, then consult the servletcontainer documentation on the matter. You didn't tell which one you're using, but in case of Tomcat, it'd be a matter of editing its /conf/web.xml
to add the following entry to the <servlet>
declaration of the JSP servlet:
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
Unrelated to the concrete problem, your @page
contains a lot of default and repeated mess. It can be simplified as follows:
<%@page pageEncoding="UTF-8"%>