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.

Share:
19,053
Jack cole
Author by

Jack cole

Updated on June 15, 2022

Comments

  • Jack cole
    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 enter image description here Second enter image description here Third : from the CONSOLE

    enter image description here

    Any idea how to solve that ?

    Regards