I have a bunch of strings getting in my jsp and I iterate in my jsp. The first part of the string is like a Title and the second part is like a body. I want to put a line break after the first part. I tried putting a new line character (\n) after the first part. I tried \n\r, it didn�t work. Example: �Title \n Body� The output is Title Body. But I want to print Title Body In my jsp. Is there any way?
"Didn't work" meaning that in the browser you didn't see the two words on different lines? That would be because HTML converts newlines and other whitespace like them to a single blank. If you want two words to show up on separate lines in HTML then you need a <br> element or some other HTML method of doing that.