| Author |
How to display output in New Line using servlets
|
Vineet Menghani
Greenhorn
Joined: Sep 04, 2003
Posts: 3
|
|
Hello all, I am new to this group. Just need to know how to display output in the newline using servlets. As \n works fine in java, but it doesn't seem to be working in servlets. Is there any other escape sequence or way to do the same. Kindly suggest. Thanks & regards, Vineet
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
|
Your servlet output is most likely being interpreted as HTML by the browser. You need to either tell the browser that you are sending plain text (by setting the content type header appropriately) or generate HTML markup to display the text with the formatting you desire.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Tim Baker
Ranch Hand
Joined: Oct 04, 2003
Posts: 541
|
|
Which, to state the obvious, is the <br /> tag for newlines. If your output is already white space formatted, then you can wrap the HTML tag <pre> </pre> around your output.
|
Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
|
 |
 |
|
|
subject: How to display output in New Line using servlets
|
|
|