When adding "\n" to a Java String , the newline is not presented in a JSP but on stdin it does
19,053
In HTML, newline characters are treated like spaces, and multiple spaces are displayed as a single space. If you want to go to the next line, you must transform newline characters into <br />
, or enclose your text inside a <pre></pre>
block.
Author by
Jack cole
Updated on June 15, 2022Comments
-
Jack cole almost 2 years
When I pass a java string back to my servlet , the servlet passes that string to the jsp .
The string holds names & addresses with a new line "\n" , but when I'm trying to present that on the screen , I see a full line , however on the console the new-line is presented .
Here's a snapshot : First Second Third : from the CONSOLE
Any idea how to solve that ?
Regards