That's how HTML gets interpreted. Anything between angle brackets is a tag, and whitespace, including line terminators is meaningless.
You'll need to escape any angle bracket characters and use something like the <pre> tag to preserve formatting.
Oh, and
Java code in a
JSP has been a big no-no for almost 10 years now. You might want to do something like this in a
servlet or custom tag rather than in a JSP.