My JSP page includes several scriptlet tags.

Joe Pollard

When you use <%= %> structure, it prints out the value inside and then prints out a line break because there is one after your %>. If you are really worried about the HTML format, you can do something like:

<%= thingToPrint
%><%= secondThing
%><%= ......

That should solve the problem, though you are kind of trading nice JSP for nice HTML.