This is not a
servlet question, it's an HTML formatting issue.
The easiest way to do it is to output the data between presentation tags <pre></pre>, or you can look at CSS and find the style settings to retain formatting. The default in HTML is to treat it all as white space and ignore it.
BUT that's only if the line feeds are being retained in the database. It would be worth checking the data to make sure it's being retained correctly first.
Dave.