keith73 wrote on 04.04.2007 20:44:
> We have a JSP page that needs the line breaks to be \r\n instead of
> just \n. Pages created in Eclipse on Windows, but when they are moved
[quoted text clipped - 3 lines]
> How can I force the JSP page, via Java, JSTL or Velocity, to output
> newlines the way we need them too?
Why would you want to do that?
A JSP page returns HTML to the client.
\n or \r have no meaning in HTML you have to use <br> (or <br/> for XHTML)
Thomas
Lew - 04 Apr 2007 23:56 GMT
keith73 wrote on 04.04.2007 20:44:
>> We have a JSP page that needs the line breaks to be \r\n instead of
>> just \n. Pages created in Eclipse on Windows, but when they are moved
[quoted text clipped - 3 lines]
>> How can I force the JSP page, via Java, JSTL or Velocity, to output
>> newlines the way we need them too?
> Why would you want to do that?
>
> A JSP page returns HTML to the client.
> \n or \r have no meaning in HTML you have to use <br> (or <br/> for XHTML)
In fact, all whitespace in HTML collapses to a single space in the browser
unless you override with or <pre> or the like.
As Thomas pointed out, using one (normal) whitespace character or another (\r,
\t, \n, ' ', etc.) is not going to create different rendering on the client side.

Signature
Lew