JSP/Servlet | JSP(Java Server Pages) | Removing Whitespace from HTML
When JSP is converted to HTML, unnecessary whitespace may be generated. If you want to remove this whitespace, add trimDirectiveWhitespaces="true" to the page directive at the top.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>