Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Output from servlet is all one line long????

843841Sep 28 2005 — edited Sep 29 2005
Forgive me all if this has been answered before, but i cant find the answer.

I have a servlet which has a string value and is then sending that string out to the browser using the out.println.

The problem is that my string has 4 lines but when it appears in the web browser they are all squashed into one line instead. Hope that all make sense.

some code:

String History = " This is s string with 4 lines for example
line 2
line 3
line 4";

out.println("<td>"+History+"</td>");

The out is only as follows:

"is s string with 4 lines for example line 2 line 3 line 4"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2005
Added on Sep 28 2005
9 comments
283 views