writer.println explicitly prints newlines? maybe that will help?